This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/5338: -pedantic reports ambiguous base



>Number:         5338
>Category:       c++
>Synopsis:       -pedantic reports ambiguous base
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 09 13:26:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        3.0.3 (Debian testing/unstable)
>Organization:
BlueArc
>Environment:
System: Linux trevithick 2.4.16 #2 Mon Dec 10 15:54:50 GMT 2001 i686 unknown
Architecture: i686

	
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:
struct HwQueue
{
    void pop ();
};

struct ISPmq : HwQueue
{
};
struct ISImq : HwQueue
{
};

struct IS : ISPmq, ISImq
{
    void monk ();
};

void IS::monk()
{
    ISPmq::pop();
}

$ gcc-3.0 -c -pedantic twosamebase.cpp
twosamebase.cpp: In member function `void IS::monk()':
twosamebase.cpp:21: `HwQueue' is an ambiguous base of `IS'

Without -pedantic there is not even a warning (even with -W -Wall).

10.2.1 says "for a qualified-id, name lookup begins in the scope of the nested-name-specifier".  In which scope, I don't think the reference to pop() or HWQueue, for that matter, is ambiguous.

>How-To-Repeat:
	
>Fix:
	Workaround: this->ISPmq::pop(); works fine.



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]