public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39541] New: Templates class instantiation -name lookup
@ 2009-03-24 10:10 anubhav dot saxena at wipro dot com
2009-04-16 20:38 ` [Bug c++/39541] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: anubhav dot saxena at wipro dot com @ 2009-03-24 10:10 UTC (permalink / raw)
To: gcc-bugs
Hi,
Consider the code
struct A{
void fn(){cout << "1";}
};
template<class T>
struct B{
void fn(){cout << "2";}
};
template<class T>
struct C : A, B<T>{
C(){ fn(); } // fn is a non dependent name.
};
int main(){
C<int> c;
}
In this case, it looks fairly intuitive that the call to 'fn' is ambiguous.
However there are two things that I am not able to resolve
a) I cannot find anything in the Standard that talk about such a scenario.
Going by the rules of non dependent names (bound in lookup phase 1), fn should
be in fact bound to A::fn.
b) Comeau online compiler accepts this code and compiles it fine.
So, I want to confirm if gcc 4.1.1 behavior is right? Any relevant quotes from
the Standard will also help.
Regards,
Anubhav.
--
Summary: Templates class instantiation -name lookup
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: anubhav dot saxena at wipro dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39541
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/39541] Templates class instantiation -name lookup
2009-03-24 10:10 [Bug c++/39541] New: Templates class instantiation -name lookup anubhav dot saxena at wipro dot com
@ 2009-04-16 20:38 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-16 20:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2009-04-16 20:38 -------
*** This bug has been marked as a duplicate of 15272 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39541
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-04-16 20:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-24 10:10 [Bug c++/39541] New: Templates class instantiation -name lookup anubhav dot saxena at wipro dot com
2009-04-16 20:38 ` [Bug c++/39541] " pinskia 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).