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++/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


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


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