From 944f42fc29289812416f34d7b0c497ee79065396 Mon Sep 17 00:00:00 2001 From: emsr Date: Wed, 26 Jun 2013 03:35:54 +0000 Subject: [PATCH] gcc/cp: 2013-06-25 Ed Smith-Rowland <3dw4rd@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 <3dw4rd@verizon.net> PR c++/57640 * g++.dg/cpp1y/pr57640.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200415 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/parser.c | 3 +-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp1y/pr57640.C | 8 ++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp1y/pr57640.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 97d7fad..bd82693 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-06-25 Ed Smith-Rowland <3dw4rd@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. + 2013-06-22 Gabriel Dos Reis * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f3bc27a..ec8ad46 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -5000,7 +5000,7 @@ cp_parser_unqualified_id (cp_parser* parser, { /* 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 +12346,6 @@ cp_literal_operator_id (const char* name) + 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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 911648b..5e1f52e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-06-25 Ed Smith-Rowland <3dw4rd@verizon.net> + + PR c++/57640 + * g++.dg/cpp1y/pr57640.C: New. + 2013-06-25 Balaji V. Iyer PR c/57692 diff --git a/gcc/testsuite/g++.dg/cpp1y/pr57640.C b/gcc/testsuite/g++.dg/cpp1y/pr57640.C new file mode 100644 index 0000000..e26f967 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr57640.C @@ -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); -- 2.7.4