[LLVMbugs] [Bug 15852] New: using T::T inside template <typename T> not accepted, leads to bogus errors.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 26 08:25:11 PDT 2013


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

            Bug ID: 15852
           Summary: using T::T inside template <typename T> not
                    accepted,leads to bogus errors.
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: benjamin.redelings at duke.edu
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10429
  --> http://llvm.org/bugs/attachment.cgi?id=10429&action=edit
Test case

The attached test case leads to the following compilation errors:

$ clang++ -std=c++11 test.C
test.C:32:17: error: template argument for template type parameter must be a
type
  Box(const Box<T>&) = default;
                ^
test.C:11:19: note: template parameter is declared here
template<typename T>
                  ^
test.C:33:22: error: unknown type name 'T'
  explicit Box(const T& t):T(t) {}
                     ^
test.C:15:41: error: template argument for template type parameter must be a
type
  Box<T>* clone() const {return new Box<T>(*this);}
                                        ^
test.C:11:19: note: template parameter is declared here
template<typename T>
                  ^
test.C:29:12: error: no member named 'T' in 'A'
  using T::T;
        ~~~^
test.C:38:10: note: in instantiation of template class 'Box<A>' requested here
  Box<A> a;
         ^
4 errors generated.

These errors go away if "using T::T" is commented out.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130426/f816c864/attachment.html>


More information about the llvm-bugs mailing list