[Bug c++/15814] New: functions with namespace qualifiers in templated functions which are dependent on the templated type search for the function at parse time instead of instantiation time

rdelashmit at soe dot sony dot com gcc-bugzilla@gcc.gnu.org
Thu Jun 3 22:27:00 GMT 2004


This occurs with 3.4.0 and 3.5.0(cvs as of 6/3/2004), but not with 2.95.3, 
3.2.3, or 3.3.3.  Code to reproduce is below.  As I understand it, Foo::baz
(value) in the code below should find the function at instantiation time, 
because it is dependant on the template parameter ValueType, but errors out at 
parse time instead.  If baz(value) rather than Foo::baz(value) is used, this 
appears to work correctly.

namespace Foo
{
  template <class ValueType>
  void bar(ValueType value)
  {
    #if 1
    Foo::baz(value); // this version does not compile
    #else
    baz(value); // this version compiles
    #endif
  }

  void baz(int) {}

}

void test()
{
  Foo::bar<int>(0);
}

-- 
           Summary: functions with namespace qualifiers in templated
                    functions which are dependent on the templated type
                    search for the function at parse time instead of
                    instantiation time
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rdelashmit at soe dot sony dot com
                CC: gcc-bugs at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list