[LLVMbugs] [Bug 13004] New: wrong diagnostic on incorrect template class definition

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 1 04:33:14 PDT 2012


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

             Bug #: 13004
           Summary: wrong diagnostic on incorrect template class
                    definition
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: vanyacpp at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This code:

template <typename A, typename A1>
struct X
{
    template <typename B>
    struct Y
    {
        template <typename C>
        struct Z;
    };
};

template <typename A, typename A1>
template <typename B>
template <typename C>
struct X<A1, A>::Y<B>::Z
{
};

Gives wrong error message and wrong fix-it hint:

7.cpp:15:18: error: use 'template' keyword to treat 'Y' as a dependent template
name
struct X<A1, A>::Y<B>::Z
                 ^
                 template 
7.cpp:13:1: error: extraneous template parameter list in template
specialization or out-of-line template definition
template <typename B>
^~~~~~~~~~~~~~~~~~~~~
2 errors generated.

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