aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2016-06-02 23:10:33 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2016-06-02 23:10:33 +0000
commitb872d7297d35e31f3254c5476e2ed4fa068e75db (patch)
treea365245cead53b4139687372ac8dba5ad3c9f1cf /gcc/cp
parente29525d3df727cf907194af2874d3eb5c774226c (diff)
downloadgcc-b872d7297d35e31f3254c5476e2ed4fa068e75db.zip
gcc-b872d7297d35e31f3254c5476e2ed4fa068e75db.tar.gz
gcc-b872d7297d35e31f3254c5476e2ed4fa068e75db.tar.bz2
decl.c (xref_tag_1): Change pairs of errors to error + inform.
/cp 2016-06-02 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (xref_tag_1): Change pairs of errors to error + inform. (start_enum): Likewise. * parser.c (cp_parser_class_head): Likewise. /testsuite 2016-06-02 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp0x/forw_enum10.C: Adjust for dg-message vs dg-error. * g++.dg/cpp0x/forw_enum6.C: Likewise. * g++.dg/cpp0x/forw_enum8.C: Likewise. * g++.dg/cpp0x/override2.C: Likewise. * g++.dg/parse/crash5.C: Likewise. * g++.dg/parse/error16.C: Likewise. * g++.dg/parse/error27.C: Likewise. * g++.dg/template/qualttp15.C: Likewise. * g++.dg/template/redecl4.C: Likewise. * g++.old-deja/g++.other/crash39.C: Likewise. * g++.old-deja/g++.other/struct1.C: Likewise. * g++.old-deja/g++.pt/m9a.C: Likewise. * g++.old-deja/g++.pt/memclass10.C: Likewise. From-SVN: r237046
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c14
-rw-r--r--gcc/cp/parser.c4
3 files changed, 15 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6514071..fba9aa9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2016-06-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * decl.c (xref_tag_1): Change pairs of errors to error + inform.
+ (start_enum): Likewise.
+ * parser.c (cp_parser_class_head): Likewise.
+
2016-06-02 Jakub Jelinek <jakub@redhat.com>
PR c++/71372
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index cbbb84b..cd7143b 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -12793,7 +12793,7 @@ xref_tag_1 (enum tag_types tag_code, tree name,
&& CLASSTYPE_IS_TEMPLATE (t))
{
error ("redeclaration of %qT as a non-template", t);
- error ("previous declaration %q+D", t);
+ inform (location_of (t), "previous declaration %qD", t);
return error_mark_node;
}
@@ -13149,16 +13149,16 @@ start_enum (tree name, tree enumtype, tree underlying_type,
{
error_at (input_location, "scoped/unscoped mismatch "
"in enum %q#T", enumtype);
- error_at (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (enumtype)),
- "previous definition here");
+ inform (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (enumtype)),
+ "previous definition here");
enumtype = error_mark_node;
}
else if (ENUM_FIXED_UNDERLYING_TYPE_P (enumtype) != !! underlying_type)
{
error_at (input_location, "underlying type mismatch "
"in enum %q#T", enumtype);
- error_at (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (enumtype)),
- "previous definition here");
+ inform (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (enumtype)),
+ "previous definition here");
enumtype = error_mark_node;
}
else if (underlying_type && ENUM_UNDERLYING_TYPE (enumtype)
@@ -13169,8 +13169,8 @@ start_enum (tree name, tree enumtype, tree underlying_type,
{
error_at (input_location, "different underlying type "
"in enum %q#T", enumtype);
- error_at (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (enumtype)),
- "previous definition here");
+ inform (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (enumtype)),
+ "previous definition here");
underlying_type = NULL_TREE;
}
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 29a1b80..e01353d 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -22008,8 +22008,8 @@ cp_parser_class_head (cp_parser* parser,
{
error_at (type_start_token->location, "redefinition of %q#T",
type);
- error_at (type_start_token->location, "previous definition of %q+#T",
- type);
+ inform (location_of (type), "previous definition of %q#T",
+ type);
type = NULL_TREE;
goto done;
}