This is the mail archive of the gcc-bugs@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]

[Bug c++/11495] New: [3.4 regression] Two-stage name lookup not Koenig-aware


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [3.4 regression] Two-stage name lookup not Koenig-aware
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org

Found while looking at 11493:

Another recent regression -- this code
------------------------
namespace NS {
    struct C {};
    void foo(C);
}

template <class T> void bar() { T t; foo (t); }

template void bar<NS::C> ();
-------------------------
should be legal: foo(t) is a dependent call, so foo should be looked up
at instantiation time, and then Koenig lookup applies to find NS::foo.

In fact, recent gccs compiled this just fine, but with tonight's snapshot,
it doesn't anymore:
tmp/gg> ../build-gcc/gcc-install/bin/c++ -c x.cc
x.cc: In function `void bar() [with T = NS::C]':
x.cc:8:   instantiated from here
x.cc:6: error: `foo' undeclared (first use this function)
x.cc:6: error: (Each undeclared identifier is reported only once for each
   function it appears in.)
:256: error: `<declaration error>' is not a function,
x.cc:3: error:   conflict with `void NS::foo(NS::C)'
x.cc:6: error:   in call to `foo'

What is also pretty funny is the third to last line. This usually indicates
a built-in function, but how can a builtin have a declaration error? And
how can it conflict?

W.


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