http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44317
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED CC| |manu at gcc dot gnu.org Resolution|INVALID |--- --- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #2) > Because the eating of comma is a GNU extension. So it is enabled in GNU > compilation modes (the default, for C -std=gnu89, -std=gnu99, -std=gnu11, > for C++ -std=gnu++98, -std=gnu++03, -std=gnu++11, -std=gnu++0x, > -std=gnu++1y) but not in the more strict standard modes (-std=c{89,99,11}, > -std=c++{98,03,11,0x,1y}). But g++ does not warn with -Wpedantic, as it should. Instead it gives a very strange message about C99 in C++: test.cc:7:17: warning: ISO C99 requires rest arguments to be used [enabled by default] ASSERT( false ); ^ Clang++ does the right thing: test.cc:2:39: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu] #define ASSERT( cnd, ... ) SomeClass(),##__VA_ARGS__ ^ test.cc:3:39: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu] #define FAIL( ... ) SomeClass(),##__VA_ARGS__ ^