Re: [C++ PR57640] Explicit call of system literal operator complains about leading underscore

2013-06-25 Thread Jason Merrill

OK.

Jason


[C++ PR57640] Explicit call of system literal operator complains about leading underscore

2013-06-25 Thread Ed Smith-Rowland
This little nit was certainly latent all along but was only exposed once 
we got literal ops into the std library.
A user who calls a operator explicitly get yelled at for not having 
anunderscore.


OK after testing completes on x86_64-linux?

Ed

gcc/cp:

2013-06-25  Ed Smith-Rowland  <3dw...@verizon.net>

PR c++/57640
* parser.c (cp_parser_unqualified_id): Add declarator_p to checks
to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment.


gcc/testsuite:

2013-06-25  Ed Smith-Rowland  <3dw...@verizon.net>

PR c++/57640
* g++.dg/cpp1y/pr57640.C: New.
Index: gcc/cp/parser.c
===
--- gcc/cp/parser.c (revision 200342)
+++ gcc/cp/parser.c (working copy)
@@ -5000,7 +4999,7 @@
{
  /* 17.6.3.3.5  */
  const char *name = UDLIT_OP_SUFFIX (id);
- if (name[0] != '_' && !in_system_header)
+ if (name[0] != '_' && !in_system_header && declarator_p)
warning (0, "literal operator suffixes not preceded by %<_%>"
" are reserved for future standardization");
}
@@ -12346,7 +12345,6 @@
  + strlen (name) + 10);
   sprintf (buffer, UDLIT_OP_ANSI_FORMAT, name);
   identifier = get_identifier (buffer);
-  /*IDENTIFIER_UDLIT_OPNAME_P (identifier) = 1; If we get a flag someday. */
 
   return identifier;
 }
Index: gcc/testsuite/g++.dg/cpp1y/pr57640.C
===
--- gcc/testsuite/g++.dg/cpp1y/pr57640.C(revision 0)
+++ gcc/testsuite/g++.dg/cpp1y/pr57640.C(working copy)
@@ -0,0 +1,8 @@
+// { dg-options -std=c++1y }
+// { dg-do compile }
+
+#include 
+
+using namespace std::literals::chrono_literals;
+
+auto blooper = operator"" min(45.0L);