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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-09 
21:21:15 UTC ---
Created attachment 26869
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26869
gcc48-pr52521.patch

If ignoring possibility of parameters with default arguments, I guess the fix
could look like this.  If operator"" could have default arguments, it would
complicate things a little bit.
[over.literal]/3 lists what argument types are allowed, so IMHO it isn't
possible to have say
int operator"" _w (long double, long double = 2.0L);, but what if there is
say
int operator"" _w (const char *, std::size_t = 0);
?  Can it be called for int i = 123_w; ?  Though, [over.literal]/4 says that
a raw literal operator contains a single const char * argument and
[lex.ext]/{3,4} says that a raw literal operator is called for integer/floating
udlits, so perhaps it shouldn't call int operator"" _w (const char *,
std::size_t = 0); and the attached patch is sufficient.

Jason, what do you think?

Reply via email to