public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access [not found] <bug-20293-6594@http.gcc.gnu.org/bugzilla/> @ 2005-10-31 2:49 ` mmitchel at gcc dot gnu dot org 2005-11-14 1:32 ` mmitchel at gcc dot gnu dot org ` (4 subsequent siblings) 5 siblings, 0 replies; 14+ messages in thread From: mmitchel at gcc dot gnu dot org @ 2005-10-31 2:49 UTC (permalink / raw) To: gcc-bugs ------- Comment #7 from mmitchel at gcc dot gnu dot org 2005-10-31 02:49 ------- Leaving as P2; we should try to fix this. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access [not found] <bug-20293-6594@http.gcc.gnu.org/bugzilla/> 2005-10-31 2:49 ` [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access mmitchel at gcc dot gnu dot org @ 2005-11-14 1:32 ` mmitchel at gcc dot gnu dot org 2005-11-14 1:45 ` mmitchel at gcc dot gnu dot org ` (3 subsequent siblings) 5 siblings, 0 replies; 14+ messages in thread From: mmitchel at gcc dot gnu dot org @ 2005-11-14 1:32 UTC (permalink / raw) To: gcc-bugs -- mmitchel at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |mark at codesourcery dot com |dot org | Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access [not found] <bug-20293-6594@http.gcc.gnu.org/bugzilla/> 2005-10-31 2:49 ` [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access mmitchel at gcc dot gnu dot org 2005-11-14 1:32 ` mmitchel at gcc dot gnu dot org @ 2005-11-14 1:45 ` mmitchel at gcc dot gnu dot org 2005-11-14 1:50 ` [Bug c++/20293] [3.4/4.0 " mmitchel at gcc dot gnu dot org ` (2 subsequent siblings) 5 siblings, 0 replies; 14+ messages in thread From: mmitchel at gcc dot gnu dot org @ 2005-11-14 1:45 UTC (permalink / raw) To: gcc-bugs ------- Comment #8 from mmitchel at gcc dot gnu dot org 2005-11-14 01:45 ------- Subject: Bug 20293 Author: mmitchel Date: Mon Nov 14 01:45:19 2005 New Revision: 106879 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106879 Log: 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. Added: trunk/gcc/testsuite/g++.dg/parse/ambig4.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cxx-pretty-print.c trunk/gcc/cp/name-lookup.c trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/lookup/ambig4.C trunk/gcc/testsuite/g++.dg/lookup/ambig5.C trunk/gcc/testsuite/g++.dg/lookup/strong-using-2.C trunk/gcc/testsuite/g++.dg/parse/crash22.C trunk/gcc/testsuite/g++.dg/tc1/dr101.C -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0 regression] Wrong diagnostic for ambiguous access [not found] <bug-20293-6594@http.gcc.gnu.org/bugzilla/> ` (2 preceding siblings ...) 2005-11-14 1:45 ` mmitchel at gcc dot gnu dot org @ 2005-11-14 1:50 ` mmitchel at gcc dot gnu dot org 2006-03-11 3:17 ` mmitchel at gcc dot gnu dot org 2007-01-18 3:39 ` [Bug c++/20293] [4.0 " gdr at gcc dot gnu dot org 5 siblings, 0 replies; 14+ messages in thread From: mmitchel at gcc dot gnu dot org @ 2005-11-14 1:50 UTC (permalink / raw) To: gcc-bugs ------- Comment #9 from mmitchel at gcc dot gnu dot org 2005-11-14 01:50 ------- Fixed in 4.1. See http://gcc.gnu.org/ml/gcc-patches/2005-11/msg00942.html for considerations about backporting to other branches. -- mmitchel at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|mark at codesourcery dot com|unassigned at gcc dot gnu | |dot org Status|ASSIGNED |NEW Summary|[3.4/4.0/4.1 regression] |[3.4/4.0 regression] Wrong |Wrong diagnostic for |diagnostic for ambiguous |ambiguous access |access http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0 regression] Wrong diagnostic for ambiguous access [not found] <bug-20293-6594@http.gcc.gnu.org/bugzilla/> ` (3 preceding siblings ...) 2005-11-14 1:50 ` [Bug c++/20293] [3.4/4.0 " mmitchel at gcc dot gnu dot org @ 2006-03-11 3:17 ` mmitchel at gcc dot gnu dot org 2007-01-18 3:39 ` [Bug c++/20293] [4.0 " gdr at gcc dot gnu dot org 5 siblings, 0 replies; 14+ messages in thread From: mmitchel at gcc dot gnu dot org @ 2006-03-11 3:17 UTC (permalink / raw) To: gcc-bugs -- mmitchel at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.0.3 |4.0.4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [4.0 regression] Wrong diagnostic for ambiguous access [not found] <bug-20293-6594@http.gcc.gnu.org/bugzilla/> ` (4 preceding siblings ...) 2006-03-11 3:17 ` mmitchel at gcc dot gnu dot org @ 2007-01-18 3:39 ` gdr at gcc dot gnu dot org 5 siblings, 0 replies; 14+ messages in thread From: gdr at gcc dot gnu dot org @ 2007-01-18 3:39 UTC (permalink / raw) To: gcc-bugs ------- Comment #10 from gdr at gcc dot gnu dot org 2007-01-18 03:39 ------- Fixed in 4.1.0. -- gdr at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Target Milestone|4.0.4 |4.1.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] New: namespace name lost @ 2005-03-02 22:19 igodard at pacbell dot net 2005-03-02 23:03 ` [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access bangerth at dealii dot org ` (7 more replies) 0 siblings, 8 replies; 14+ messages in thread From: igodard at pacbell dot net @ 2005-03-02 22:19 UTC (permalink / raw) To: gcc-bugs In: namespace hide { int k; } namespace { int i; namespace hide { int j; } } void F(int) {} int main() { F(i); F(hide::j); } you get: ~/ootbc/members/src$ g++ foo.cc foo.cc: In function `int main()': foo.cc:16: error: `hide' has not been declared foo.cc:16: error: `j' undeclared (first use this function) foo.cc:16: error: (Each undeclared identifier is reported only once for each function it appears in.) i.e. the lookup for "hide" fails whereas a simple variable "i" is found. My (probably erroneous) understanding is that the anonymous namespace has no impact on name scope; exports all names declared within it to filescope; and simply replaces the old "static" to prevent cluttering the linker namespace. That seems to be the case with "i". However, if that rule were applied to "hide" then the two "hide"s would be at the same level and would merge as namespaces do, rather than the inner one being hidden as happened. This problem arose because I was trying to declare a filescope name ("j") in a way that *neither* cluttered the compiler's space nor the linkers. If this is in fact an error, please change this report to a complaint about the diagnostic. Ivan -- Summary: namespace name lost Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: igodard at pacbell dot net CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access 2005-03-02 22:19 [Bug c++/20293] New: namespace name lost igodard at pacbell dot net @ 2005-03-02 23:03 ` bangerth at dealii dot org 2005-03-02 23:24 ` giovannibajo at libero dot it ` (6 subsequent siblings) 7 siblings, 0 replies; 14+ messages in thread From: bangerth at dealii dot org @ 2005-03-02 23:03 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From bangerth at dealii dot org 2005-03-02 23:03 ------- This is indeed a diagnostic problem: the access is ambiguous, but instead of saying so gcc chooses to mention that there is no such name at all. This happens in many places, and I believe that there must be at least half a dozen PRs about this. This is in fact also a regression, since before the new parser we got this: g/x> /home/bangerth/bin/gcc-3.3*/bin/c++ -c x.cc x.cc: In function `int main()': x.cc:16: error: use of `hide' is ambiguous x.cc:1: error: first declared as `hide' here x.cc:7: error: also declared as `<unnamed>::hide' here x.cc:16: error: parse error before `::' token icc says this: g/x> icc -c x.cc x.cc(16): error: "hide" is ambiguous F(hide::j); ^ compilation aborted for x.cc (code 2) W. -- What |Removed |Added ---------------------------------------------------------------------------- BugsThisDependsOn|100, 12272 | Severity|enhancement |normal Known to fail| |3.4.3 4.0.0 4.1.0 Known to work| |2.95 3.2 3.3 Last reconfirmed|2005-03-02 23:01:37 |2005-03-02 23:03:15 date| | Summary|ambiguous namespace and |[3.4/4.0/4.1 regression] |diagnostic, unamed namespace|Wrong diagnostic for | |ambiguous access Target Milestone|--- |3.4.4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access 2005-03-02 22:19 [Bug c++/20293] New: namespace name lost igodard at pacbell dot net 2005-03-02 23:03 ` [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access bangerth at dealii dot org @ 2005-03-02 23:24 ` giovannibajo at libero dot it 2005-03-08 2:31 ` pinskia at gcc dot gnu dot org ` (5 subsequent siblings) 7 siblings, 0 replies; 14+ messages in thread From: giovannibajo at libero dot it @ 2005-03-02 23:24 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From giovannibajo at libero dot it 2005-03-02 23:24 ------- (merging bugzilla conflicts...) -- What |Removed |Added ---------------------------------------------------------------------------- BugsThisDependsOn| |100, 12272 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access 2005-03-02 22:19 [Bug c++/20293] New: namespace name lost igodard at pacbell dot net 2005-03-02 23:03 ` [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access bangerth at dealii dot org 2005-03-02 23:24 ` giovannibajo at libero dot it @ 2005-03-08 2:31 ` pinskia at gcc dot gnu dot org 2005-03-11 16:27 ` lerdsuwa at gcc dot gnu dot org ` (4 subsequent siblings) 7 siblings, 0 replies; 14+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-03-08 2:31 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-08 02:31 ------- The diagnostic changed when the new parser was merged in (between 20021213 and 20021228). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access 2005-03-02 22:19 [Bug c++/20293] New: namespace name lost igodard at pacbell dot net ` (2 preceding siblings ...) 2005-03-08 2:31 ` pinskia at gcc dot gnu dot org @ 2005-03-11 16:27 ` lerdsuwa at gcc dot gnu dot org 2005-05-19 17:35 ` mmitchel at gcc dot gnu dot org ` (3 subsequent siblings) 7 siblings, 0 replies; 14+ messages in thread From: lerdsuwa at gcc dot gnu dot org @ 2005-03-11 16:27 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From lerdsuwa at gcc dot gnu dot org 2005-03-11 16:27 ------- The diagnostic is missing due to calling lookup_name_real inside cp_parser_lookup_name without the LOOKUP_COMPLAIN flag. Too bad we cannot just add this flag because this will cause duplicate error messages. cp_parser_lookup_name are called multiple times during tentative parse. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access 2005-03-02 22:19 [Bug c++/20293] New: namespace name lost igodard at pacbell dot net ` (3 preceding siblings ...) 2005-03-11 16:27 ` lerdsuwa at gcc dot gnu dot org @ 2005-05-19 17:35 ` mmitchel at gcc dot gnu dot org 2005-07-22 21:17 ` pinskia at gcc dot gnu dot org ` (2 subsequent siblings) 7 siblings, 0 replies; 14+ messages in thread From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:35 UTC (permalink / raw) To: gcc-bugs -- What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|3.4.4 |3.4.5 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access 2005-03-02 22:19 [Bug c++/20293] New: namespace name lost igodard at pacbell dot net ` (4 preceding siblings ...) 2005-05-19 17:35 ` mmitchel at gcc dot gnu dot org @ 2005-07-22 21:17 ` pinskia at gcc dot gnu dot org 2005-09-11 1:51 ` bangerth at dealii dot org 2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org 7 siblings, 0 replies; 14+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-07-22 21:17 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-22 21:13 ------- Moving to 4.0.2 pre Mark. -- What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|3.4.5 |4.0.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access 2005-03-02 22:19 [Bug c++/20293] New: namespace name lost igodard at pacbell dot net ` (5 preceding siblings ...) 2005-07-22 21:17 ` pinskia at gcc dot gnu dot org @ 2005-09-11 1:51 ` bangerth at dealii dot org 2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org 7 siblings, 0 replies; 14+ messages in thread From: bangerth at dealii dot org @ 2005-09-11 1:51 UTC (permalink / raw) To: gcc-bugs -- Bug 20293 depends on bug 100, which changed state. Bug 100 Summary: confusing name lookup diagnostic http://gcc.gnu.org/bugzilla/show_bug.cgi?id=100 What |Old Value |New Value ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access 2005-03-02 22:19 [Bug c++/20293] New: namespace name lost igodard at pacbell dot net ` (6 preceding siblings ...) 2005-09-11 1:51 ` bangerth at dealii dot org @ 2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org 7 siblings, 0 replies; 14+ messages in thread From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:13 UTC (permalink / raw) To: gcc-bugs -- What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.0.2 |4.0.3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20293 ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2007-01-18 3:39 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <bug-20293-6594@http.gcc.gnu.org/bugzilla/> 2005-10-31 2:49 ` [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access mmitchel at gcc dot gnu dot org 2005-11-14 1:32 ` mmitchel at gcc dot gnu dot org 2005-11-14 1:45 ` mmitchel at gcc dot gnu dot org 2005-11-14 1:50 ` [Bug c++/20293] [3.4/4.0 " mmitchel at gcc dot gnu dot org 2006-03-11 3:17 ` mmitchel at gcc dot gnu dot org 2007-01-18 3:39 ` [Bug c++/20293] [4.0 " gdr at gcc dot gnu dot org 2005-03-02 22:19 [Bug c++/20293] New: namespace name lost igodard at pacbell dot net 2005-03-02 23:03 ` [Bug c++/20293] [3.4/4.0/4.1 regression] Wrong diagnostic for ambiguous access bangerth at dealii dot org 2005-03-02 23:24 ` giovannibajo at libero dot it 2005-03-08 2:31 ` pinskia at gcc dot gnu dot org 2005-03-11 16:27 ` lerdsuwa at gcc dot gnu dot org 2005-05-19 17:35 ` mmitchel at gcc dot gnu dot org 2005-07-22 21:17 ` pinskia at gcc dot gnu dot org 2005-09-11 1:51 ` bangerth at dealii dot org 2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).