[LLVMbugs] [Bug 11245] New: clang incorrectly accepts ::template S<...>

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 27 10:58:35 PDT 2011


           Summary: clang incorrectly accepts ::template S<...>
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

clang accepts this in C++11 mode, and with a warning in C++98 mode:

template<typename T> struct S {};
::template S<int> s;

This is not legal in either language (and not legal even within a template in
C++98). The grammar for elaborated-type-specifiers requires a
nested-name-specifier before the 'template' keyword in this context, and :: is
not one.

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