re PR c++/20293 (Wrong diagnostic for ambiguous access)
authorMark Mitchell <mark@codesourcery.com>
Mon, 14 Nov 2005 01:45:19 +0000 (01:45 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 14 Nov 2005 01:45:19 +0000 (01:45 +0000)
commit91b1ca65f39ecca8525536d3f4dfa80144e68afd
tree773dff07d2e51d7d8497844932653849d2201ca9
parent43258b67a9f414823ec75d2b9c2d9596c6317824
re PR c++/20293 (Wrong diagnostic for ambiguous access)

PR c++/20293
* cxx-pretty-print.c (pp_cxx_statement): Print qualifying scopes
for namespaces.
(pp_cxx_original_namespace_definition): Likewise.
* name-lookup.c (ambiguous_decl): Don't issue error messages;
instead return lists of ambiguous candidates.
(select_decl): Handle ambiguous namespace lookups.
* parser.c (cp_token): Add ambiguous_p.
(cp_lexer_get_preprocessor_token): Set it.
(cp_parser_diagnose_invalid_type_name): Avoid duplicate messages
when a qualified name uses an invalid scope.
(cp_parser_primary_expression): Print ambiguous candidates.
(cp_parser_type_parameter): Adjust comment to reflect new
parameter name for cp_parser_lookup_name.
(cp_parser_template_argument): Likewise.
(cp_parser_elaborated_type_specifier): Likewise.
(cp_parser_namespace_name): Likewise.
(cp_parser_class_name): Print ambiguous candidates.
(cp_parser_lookup_name): Rename ambiguous_p parameter to
ambiguous_decls.  Use it to return a list of ambiguous candiates
when a lookup is ambiguous.
(cp_parser_lookup_name_simple): Adjust comment to reflect new
parameter name for cp_parser_lookup_name.

PR c++/20293
* g++.dg/parse/ambig4.C: New test.
* g++.dg/tc1/dr101.C: Adjust error markers.
* g++.dg/lookup/strong-using-2.C: Likewise.
* g++.dg/lookup/ambig5.C: Likewise.
* g++.dg/lookup/ambig4.C: Likewise.
* g++.dg/parse/crash22.C: Likewise.

From-SVN: r106879
gcc/cp/ChangeLog
gcc/cp/cxx-pretty-print.c
gcc/cp/name-lookup.c
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lookup/ambig4.C
gcc/testsuite/g++.dg/lookup/ambig5.C
gcc/testsuite/g++.dg/lookup/strong-using-2.C
gcc/testsuite/g++.dg/parse/ambig4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/crash22.C
gcc/testsuite/g++.dg/tc1/dr101.C