aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2013-06-12 14:03:28 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2013-06-12 14:03:28 +0000
commite20eae6a8dd495f17a867855e384e6cbea99d61f (patch)
tree213bd1e1bd6d646a5d21381f9d6244dbb3ed7867 /gcc
parentcddd69eb6d95094c00792899f59ca3d9381b2254 (diff)
downloadgcc-e20eae6a8dd495f17a867855e384e6cbea99d61f.zip
gcc-e20eae6a8dd495f17a867855e384e6cbea99d61f.tar.gz
gcc-e20eae6a8dd495f17a867855e384e6cbea99d61f.tar.bz2
re PR c++/42021 (Misleading error message when inherited typedefs cause ambiguity)
2013-06-12 Paolo Carlini <paolo.carlini@oracle.com> PR c++/42021 * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting again diagnostic already emitted by cp_parser_lookup_name. From-SVN: r200013
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog10
-rw-r--r--gcc/cp/parser.c14
2 files changed, 18 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 144f1fc..c8a9e12 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,8 +1,14 @@
+2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/42021
+ * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
+ again diagnostic already emitted by cp_parser_lookup_name.
+
2013-06-11 Jan Hubicka <jh@suse.cz>
PR c++/57551
- * cp/pt.c (mark_decl_instantiated): Do not export explicit instantiations
- of anonymous namespace templates.
+ * cp/pt.c (mark_decl_instantiated): Do not export explicit
+ instantiations of anonymous namespace templates.
2013-06-10 Jason Merrill <jason@redhat.com>
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 319da21..7b4c358 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -5230,10 +5230,16 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
decl);
else if (ambiguous_decls)
{
- error_at (token->location,
- "reference to %qD is ambiguous",
- token->u.value);
- print_candidates (ambiguous_decls);
+ // cp_parser_lookup_name has the same diagnostic,
+ // thus make sure to emit it almost once.
+ if (cp_parser_uncommitted_to_tentative_parse_p
+ (parser))
+ {
+ error_at (token->location,
+ "reference to %qD is ambiguous",
+ token->u.value);
+ print_candidates (ambiguous_decls);
+ }
decl = error_mark_node;
}
else