[Bug c++/51314] [C++0x] sizeof... and parentheses

marc.glisse at normalesup dot org gcc-bugzilla@gcc.gnu.org
Thu Apr 19 21:20:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51314

--- Comment #2 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-19 21:19:23 UTC ---
Created attachment 27200
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27200
patch

s.cc: In function 'void f(U ...)':
s.cc:3:18: error: 'sizeof...' argument must be surrounded by parentheses
       A<sizeof...U> x; // template argument 1 is invalid
                  ^
s.cc:3:19: error: template argument 1 is invalid
       A<sizeof...U> x; // template argument 1 is invalid
                   ^
s.cc:3:22: error: invalid type in declaration before ';' token
       A<sizeof...U> x; // template argument 1 is invalid
                      ^
s.cc: At global scope:
s.cc:10:37: error: 'sizeof...' argument must be surrounded by parentheses
       typedef Indices<I...,sizeof...I> type; // OK
                                     ^

Error recovery is not that great in the first case, but fine in the second.



More information about the Gcc-bugs mailing list