Bug 47585 - remaining dependent base lookup
Summary: remaining dependent base lookup
Status: RESOLVED DUPLICATE of bug 24163
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-02 09:06 UTC by Richard B. Kreckel
Modified: 2011-02-02 11:57 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard B. Kreckel 2011-02-02 09:06:35 UTC
G++ accepts this invalid code:

template <class T>
struct base {
     void f(void*);
};

template <class T>
struct derived : base<T> {
     derived() { f(this); } /* note: f(0) breaks g++, too */
};

struct instanced : derived<unsigned> {
     instanced() {}
};

See a recent discussion on news:comp.lang.c++.moderated about this:
<http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/ba5a7a368233a022>
Comment 1 Jonathan Wakely 2011-02-02 11:50:00 UTC
dup of PR 24163 ?
Comment 2 Jonathan Wakely 2011-02-02 11:57:52 UTC
yes, I'm sure this is the same, as in the bug I reported, base<T>::f is only found if the expression is dependent (so lookup is delayed to instantiation time) but that shouldn't affect it. 14.6.2/3 is clear that dependent bases are not examined for unqualified name lookup at definition or instantiation

*** This bug has been marked as a duplicate of bug 24163 ***