[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


             Bug #: 13863
           Summary: Failure to match definition of class template member
           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()

Clang generates an error as -

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

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