This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/2922: two-phase name lookup not working
- To: nobody at gcc dot gnu dot org
- Subject: Re: c++/2922: two-phase name lookup not working
- From: Martin Sebor <sebor at roguewave dot com>
- Date: 24 May 2001 21:46:03 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: Martin Sebor <sebor at roguewave dot com>
The following reply was made to PR c++/2922; it has been noted by GNATS.
From: Martin Sebor <sebor@roguewave.com>
To: Jens.Maurer@gmx.net
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/2922: two-phase name lookup not working
Date: Thu, 24 May 2001 15:47:15 -0600
Jens.Maurer@gmx.net wrote:
>
> >Number: 2922
> >Category: c++
> >Synopsis: two-phase name lookup not working
> >Confidential: no
> >Severity: serious
> >Priority: medium
> >Responsible: unassigned
> >State: open
> >Class: wrong-code
> >Submitter-Id: net
> >Arrival-Date: Thu May 24 02:06:01 PDT 2001
> >Closed-Date:
> >Last-Modified:
> >Originator: Jens Maurer
> >Release: gcc version 3.0 20010521 (prerelease)
> >Organization:
> >Environment:
> Linux 2.2.4 with glibc 2.2.3
> >Description:
> The program below is supposed to output
> f(char)
> f(int)
> f(char)
> f(char)
>
> according to 14.6p9.
But take a look at issue 197 at
http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#197
Not that the issue makes gcc's behavior correct (f(char) should
apparently be called in all 4 cases).
Regards
Martin
>
> gcc (all of 2.95.3, pre-3.0, and 3.1 20010518) outputs
> f(int)
> f(int)
> f(int)
> f(char)
> >How-To-Repeat:
>
> // example (slightly adapted) from 14.6p9
>
> #include <iostream>
>
> void f(char)
> {
> std::cout << "f(char)" << std::endl;
> }
>
> template<class T>
> void g(T t)
> {
> f(1); // not dependent
> f(t); // dependent
> }
>
> void f(int)
> {
> std::cout << "f(int)" << std::endl;
> }
>
> int main()
> {
> g(2); // f(char) followed by f(int)
> g('a'); // two f(char)
> }
>
> >Fix:
>
> >Release-Note:
> >Audit-Trail:
> >Unformatted: