Re: [C++-0x] User defined literals.

2011-07-20 Thread Jason Merrill
On 07/20/2011 05:32 PM, Ed Smith-Rowland wrote: Now I have a real question: Since a shadowed suffix *cannot* act like the user wants no matter what, should I error instead of warn? It doesn't seem any more erroneous than any other suffix without a leading underscore, even though it isn't very

Re: [C++-0x] User defined literals.

2011-07-20 Thread Ed Smith-Rowland
On 07/12/2011 04:56 PM, Jason Merrill wrote: A few more notes: + if (DECL_NAMESPACE_SCOPE_P (decl)) + { + if (!check_literal_operator_args(decl, + &long_long_unsigned_p, &long_double_p)) + { + error ("%qD has illegal argument list", decl); +

Re: [C++-0x] User defined literals.

2011-07-17 Thread Jason Merrill
On 07/17/2011 01:01 AM, Ed Smith-Rowland wrote: On 07/12/2011 04:56 PM, Jason Merrill wrote: Doesn't the shadowing apply everywhere, not just at file scope? Yes, the shadowing should apply everywhere. What test do I use to get that? I seem to remember trying something like global_p without succ

Re: [C++-0x] User defined literals.

2011-07-17 Thread Ed Smith-Rowland
On 07/12/2011 04:56 PM, Jason Merrill wrote: A few more notes: + if (DECL_NAMESPACE_SCOPE_P (decl)) + { + if (!check_literal_operator_args(decl, + &long_long_unsigned_p, &long_double_p)) + { + error ("%qD has illegal argument list", decl); +

Re: [C++-0x] User defined literals.

2011-07-12 Thread Jason Merrill
A few more notes: + if (DECL_NAMESPACE_SCOPE_P (decl)) + { + if (!check_literal_operator_args(decl, +&long_long_unsigned_p, &long_double_p)) + { + error ("%qD has illegal argument list", decl); + return

Re: [C++-0x] User defined literals.

2011-07-12 Thread Jason Merrill
Hmm, sorry I didn't notice this patch until now. Please CC me on C++ patches, and feel free to ping me if I don't respond promptly. Thanks for working on this! 2. Templates don't really work. This is proving difficult for my little brain. I need to parse this: 123_abc; and replace it with

Re: [C++0x] User-Defined Literals

2011-04-12 Thread Joseph S. Myers
On Mon, 11 Apr 2011, Ed Smith-Rowland wrote: > +case CPP_CHAR_USERDEF: > +case CPP_WCHAR_USERDEF: > +case CPP_CHAR16_USERDEF: > +case CPP_CHAR32_USERDEF: > + { > + tree literal; > + cpp_token temp_tok = *tok; > + char suffix[256] = ""; > + cpp_get_userdef_suffi