Skip to content

clang incorrectly accepts ::template S<...> #11617

@zygoloid

Description

@zygoloid
mannequin
Bugzilla Link 11245
Resolution FIXED
Resolved on Oct 17, 2012 11:47
Version unspecified
OS Linux
CC @DougGregor

Extended Description

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

template struct S {};
::template S 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++11

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions