It seems you found a feature of the gcc compiler: an undocumented extension that cannot be suppressed or be warned about by using any options (such as -pedantic -std=XXXX).

If you want to be reasonably certain that your code complies with the standard, I recommend to always use a variety of compilers and make sure your code passes all of them without warnings (and use the most strict warning options). gcc and clang are free, so you can always use at least two compilers (and clang is quite good at standard compliance).