aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-05-09 13:51:05 +0000
committerJason Merrill <jason@redhat.com>2013-05-09 13:51:05 +0000
commitc43cea83a4818a5e4ed480c3a012e5ca749de622 (patch)
tree7eb173a779e618bb0761ed669ef9657c1edf0629 /gcc/cp
parent919d3fd5a4503fb83ab8624aff6d09cf90392661 (diff)
PR c++/57068
* decl.c (grokdeclarator): Warn about ref-qualifiers here. * parser.c (cp_parser_ref_qualifier_seq_opt): Not here. * error.c (maybe_warn_cpp0x): s/0x/11/. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@198738 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl.c1
-rw-r--r--gcc/cp/error.c4
-rw-r--r--gcc/cp/parser.c1
4 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b91a4c572ae..89f827214b3 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2013-05-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/57068
+ * decl.c (grokdeclarator): Warn about ref-qualifiers here.
+ * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
+ * error.c (maybe_warn_cpp0x): s/0x/11/.
+
2013-05-08 Marc Glisse <marc.glisse@inria.fr>
* typeck.c (cp_build_binary_op): Call save_expr before
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 95937fe53aa..f2b63080505 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9562,6 +9562,7 @@ grokdeclarator (const cp_declarator *declarator,
if (rqual)
{
+ maybe_warn_cpp0x (CPP0X_REF_QUALIFIER);
error ((flags == DTOR_FLAG)
? "destructors may not be ref-qualified"
: "constructors may not be ref-qualified");
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index a7584566524..35ea0dfe72d 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -3366,7 +3366,7 @@ maybe_warn_cpp0x (cpp0x_warn_str str)
break;
case CPP0X_AUTO:
pedwarn (input_location, 0,
- "C++0x auto only available with -std=c++11 or -std=gnu++11");
+ "C++11 auto only available with -std=c++11 or -std=gnu++11");
break;
case CPP0X_SCOPED_ENUMS:
pedwarn (input_location, 0,
@@ -3415,7 +3415,7 @@ maybe_warn_cpp0x (cpp0x_warn_str str)
case CPP0X_REF_QUALIFIER:
pedwarn (input_location, 0,
"ref-qualifiers "
- "only available with -std=c++0x or -std=gnu++0x");
+ "only available with -std=c++11 or -std=gnu++11");
break;
default:
gcc_unreachable ();
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 40e5788ad99..abc49b69f2c 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -16994,7 +16994,6 @@ cp_parser_ref_qualifier_seq_opt (cp_parser* parser)
if (ref_qual)
{
- maybe_warn_cpp0x (CPP0X_REF_QUALIFIER);
cp_lexer_consume_token (parser->lexer);
}