public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15272] New: lookup, dependent base
@ 2004-05-03 22:29 belz at kolumbus dot fi
  2004-05-03 22:57 ` [Bug c++/15272] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: belz at kolumbus dot fi @ 2004-05-03 22:29 UTC (permalink / raw)
  To: gcc-bugs

Following code:

struct X
{
    void f();
};

struct Y
{
    void f();
};

template <typename Base>
struct A : Base, X {
  virtual void foo()
  {
    f();
  }
};

int main()
{
    A<Y> t;
}

gives error message:
j_test.cpp: In member function `void A<Base>::foo() [with Base = Y]':
j_test.cpp:21:   instantiated from here
j_test.cpp:16: error: request for member `f' is ambiguous
j_test.cpp:4: error: candidates are: void X::f()
j_test.cpp:9: error:                 void Y::f() = Y]':

Even though the dependent base should not be considered.
This seems to happen only when foo is virtual and f is found from 
non-dependent base.

Using:
Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/specs
Configured with: ../gcc/configure --enable-languages=c++,c,f77 
--enable-threads=posix
Thread model: posix
gcc version 3.4.1 20040501 (prerelease)

-- 
           Summary: lookup, dependent base
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: belz at kolumbus dot fi
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 15+ messages in thread
[parent not found: <bug-15272-7190@http.gcc.gnu.org/bugzilla/>]
[parent not found: <bug-15272-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2021-08-23  0:47 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-03 22:29 [Bug c++/15272] New: lookup, dependent base belz at kolumbus dot fi
2004-05-03 22:57 ` [Bug c++/15272] " pinskia at gcc dot gnu dot org
2004-05-04  2:07 ` bangerth at dealii dot org
2004-05-04 11:37 ` belz at kolumbus dot fi
2004-08-03  1:47 ` pinskia at gcc dot gnu dot org
2005-07-21  4:51 ` pinskia at gcc dot gnu dot org
     [not found] <bug-15272-7190@http.gcc.gnu.org/bugzilla/>
2006-12-11  8:10 ` pinskia at gcc dot gnu dot org
2009-04-16 20:38 ` pinskia at gcc dot gnu dot org
     [not found] <bug-15272-4@http.gcc.gnu.org/bugzilla/>
2011-10-09 13:37 ` bangerth at gmail dot com
2013-01-22  7:54 ` gcc-bugs at tesarici dot cz
2013-04-16 21:08 ` redi at gcc dot gnu.org
2013-05-19 20:33 ` paolo.carlini at oracle dot com
2014-11-24 23:45 ` redi at gcc dot gnu.org
2014-11-25  8:47 ` paolo.carlini at oracle dot com
2021-08-23  0:47 ` pinskia at gcc dot gnu.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).