public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27775] incorrect "ambiguous" error message with multiple inheritance and nested class.
       [not found] <bug-27775-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-27 17:56 ` rnewman at compubrite dot com
  2012-01-28 20:50 ` manu at gcc dot gnu.org
  2021-07-27  2:44 ` rnewman at compubrite dot com
  2 siblings, 0 replies; 5+ messages in thread
From: rnewman at compubrite dot com @ 2012-01-27 17:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27775

Rich Newman <rnewman at compubrite dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|4.0.0                       |4.5.1
      Known to fail|                            |4.3.0, 4.3.4, 4.4.4, 4.5.1

--- Comment #3 from Rich Newman <rnewman at compubrite dot com> 2012-01-27 17:12:13 UTC ---
Bug still in version 4.3.4:

$ g++ -c bug27775.cc
bug27775.cc:11: error: reference to 'B' is ambiguous
bug27775.cc:5: error: candidates are: struct A::B
bug27775.cc:5: error:                 struct A::B
bug27775.cc:11: error: reference to 'B' is ambiguous
bug27775.cc:5: error: candidates are: struct A::B
bug27775.cc:5: error:                 struct A::B
bug27775.cc:11: error: 'B' has not been declared
bug27775.cc:12: error: reference to 'B' is ambiguous
bug27775.cc:5: error: candidates are: struct A::B
bug27775.cc:5: error:                 struct A::B
bug27775.cc:12: error: reference to 'B' is ambiguous
bug27775.cc:5: error: candidates are: struct A::B
bug27775.cc:5: error:                 struct A::B
bug27775.cc:12: error: 'B' has not been declared
$ g++ -dumpversion
4.3.4

Also in version 4.4.4:
$ g++ -c bug27775.cc
bug27775.cc:11: error: reference to 'B' is ambiguous
bug27775.cc:5: error: candidates are: struct A::B
bug27775.cc:5: error:                 struct A::B
bug27775.cc:11: error: reference to 'B' is ambiguous
bug27775.cc:5: error: candidates are: struct A::B
bug27775.cc:5: error:                 struct A::B
bug27775.cc:11: error: 'B' has not been declared
bug27775.cc:12: error: reference to 'B' is ambiguous
bug27775.cc:5: error: candidates are: struct A::B
bug27775.cc:5: error:                 struct A::B
bug27775.cc:12: error: reference to 'B' is ambiguous
bug27775.cc:5: error: candidates are: struct A::B
bug27775.cc:5: error:                 struct A::B
bug27775.cc:12: error: 'B' has not been declared
$ g++ -dumpversion
4.4.4
$

Also in 4.5.1:

$ g++ -c bug27775.cc
bug27775.cc:11:14: error: reference to 'B' is ambiguous
bug27775.cc:5:5: error: candidates are: struct A::B A::B::B
bug27775.cc:5:5: error:                 struct A::B
bug27775.cc:11:14: error: 'B' has not been declared
bug27775.cc:12:14: error: reference to 'B' is ambiguous
bug27775.cc:5:5: error: candidates are: struct A::B A::B::B
bug27775.cc:5:5: error:                 struct A::B
bug27775.cc:12:14: error: 'B' has not been declared
$ g++ -dumpversion
4.5.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/27775] incorrect "ambiguous" error message with multiple inheritance and nested class.
       [not found] <bug-27775-4@http.gcc.gnu.org/bugzilla/>
  2012-01-27 17:56 ` [Bug c++/27775] incorrect "ambiguous" error message with multiple inheritance and nested class rnewman at compubrite dot com
@ 2012-01-28 20:50 ` manu at gcc dot gnu.org
  2021-07-27  2:44 ` rnewman at compubrite dot com
  2 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu.org @ 2012-01-28 20:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27775

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-01-28 20:04:05 UTC ---
Also confirmed with GCC 4.7 rev 180166.

Clang 3.0 also reject this, so I am not sure whether is actually valid, but the
repeated messages are suspicious.

/tmp/webcompile/_9463_0.cc:10:14: error: member 'B' found in multiple base
classes of different types
    void foo(B b);
             ^
/tmp/webcompile/_9463_0.cc:3:12: note: member found by ambiguous name lookup
    struct B
           ^
/tmp/webcompile/_9463_0.cc:3:12: note: member found by ambiguous name lookup
/tmp/webcompile/_9463_0.cc:11:14: error: member 'B' found in multiple base
classes of different types
    void bar(B* pb);
             ^
/tmp/webcompile/_9463_0.cc:3:12: note: member found by ambiguous name lookup
    struct B
           ^
/tmp/webcompile/_9463_0.cc:3:12: note: member found by ambiguous name lookup
2 errors generated.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/27775] incorrect "ambiguous" error message with multiple inheritance and nested class.
       [not found] <bug-27775-4@http.gcc.gnu.org/bugzilla/>
  2012-01-27 17:56 ` [Bug c++/27775] incorrect "ambiguous" error message with multiple inheritance and nested class rnewman at compubrite dot com
  2012-01-28 20:50 ` manu at gcc dot gnu.org
@ 2021-07-27  2:44 ` rnewman at compubrite dot com
  2 siblings, 0 replies; 5+ messages in thread
From: rnewman at compubrite dot com @ 2021-07-27  2:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27775

--- Comment #5 from Rich Newman <rnewman at compubrite dot com> ---
(In reply to Manuel López-Ibáñez from comment #4)

> Clang 3.0 also reject this, so I am not sure whether is actually valid, but
> the repeated messages are suspicious.
> 

EDG accepts it, and I can see nothing wrong with the code according to the
standards.


The following versions of GCC also reject it with substantially similar error
messages:

10.1.0
11.1.0
5.4.0
6.3.0
7.1.0
7.4.0
8.1.0
8.3.0
9.1.0
9.2.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/27775] incorrect "ambiguous" error message with multiple inheritance and nested class.
  2006-05-26 22:50 [Bug c++/27775] New: " rnewman at compubrite dot com
  2006-08-06 22:19 ` [Bug c++/27775] " bangerth at dealii dot org
@ 2008-08-10  9:50 ` kristian dot spangsege at gmail dot com
  1 sibling, 0 replies; 5+ messages in thread
From: kristian dot spangsege at gmail dot com @ 2008-08-10  9:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from kristian dot spangsege at gmail dot com  2008-08-10 09:49 -------
I just confirmed this bug in GCC 4.3.0.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27775


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/27775] incorrect "ambiguous" error message with multiple inheritance and nested class.
  2006-05-26 22:50 [Bug c++/27775] New: " rnewman at compubrite dot com
@ 2006-08-06 22:19 ` bangerth at dealii dot org
  2008-08-10  9:50 ` kristian dot spangsege at gmail dot com
  1 sibling, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2006-08-06 22:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bangerth at dealii dot org  2006-08-06 22:19 -------
Confirmed. To make things worse, the diagnostic is really longish
right now as well:

g/x> c++ -c x.cc
x.cc:10: error: reference to 'B' is ambiguous
x.cc:4: error: candidates are: struct A::B
x.cc:4: error:                 struct A::B
x.cc:10: error: reference to 'B' is ambiguous
x.cc:4: error: candidates are: struct A::B
x.cc:4: error:                 struct A::B
x.cc:10: error: 'B' has not been declared
x.cc:11: error: reference to 'B' is ambiguous
x.cc:4: error: candidates are: struct A::B
x.cc:4: error:                 struct A::B
x.cc:11: error: reference to 'B' is ambiguous
x.cc:4: error: candidates are: struct A::B
x.cc:4: error:                 struct A::B
x.cc:11: error: 'B' has not been declared

The 'is ambiguous' message is apparently printed twice, and the 'has not 
been declared' message is, and has long been, bogus...

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-08-06 22:19:48
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27775


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-27  2:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-27775-4@http.gcc.gnu.org/bugzilla/>
2012-01-27 17:56 ` [Bug c++/27775] incorrect "ambiguous" error message with multiple inheritance and nested class rnewman at compubrite dot com
2012-01-28 20:50 ` manu at gcc dot gnu.org
2021-07-27  2:44 ` rnewman at compubrite dot com
2006-05-26 22:50 [Bug c++/27775] New: " rnewman at compubrite dot com
2006-08-06 22:19 ` [Bug c++/27775] " bangerth at dealii dot org
2008-08-10  9:50 ` kristian dot spangsege at gmail dot com

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).