[LLVMbugs] [Bug 13863] New: Failure to match definition of class template member function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 18 03:55:15 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13863

             Bug #: 13863
           Summary: Failure to match definition of class template member
                    function
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: kv.bhat at samsung.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


If there are dependent lookups in the type-specifier that are not dependent in
the scope of the decelerator then clang fails to compile.

e.g. in test code -

template <int dim> class X {};

template <class T> struct Y {
  static const unsigned int dim = 1;
  template <class U> X<Y<T>::dim> f();
};

template <class T> template <class U>
X<Y<T>::dim> Y<T>::f() { return X<dim>(); }

int main()
{
  Y<int>().f<int>();
}

Clang generates an error as -

D:\\P4Views\\SISO_PROFILE_BADA_NEO_KARTHIK\\SHP_TASK\\SWP1\\OSP\\OSP3.0_LLVM\\cl
ang-tests\\gcc-testsuite\\src_mod\\g++.dg\\template\\dependent-name6.C:12:20:
er
ror: out-of-line
      definition of 'f' does not match any declaration in 'Y<T>'
X<Y<T>::dim> Y<T>::f() { return X<dim>(); }


Although this is successfully compiled in gcc. 
A fix for gcc was made at
http://gcc.gnu.org/ml/gcc-patches/2010-02/msg00723.html

Would like to know if similar thing needs to be done in clang as well?

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list