Open
Description
Full name of submitter (unless configured in github; will be published with the issue):
Reference (section label): [temp.pre] p5
Issue description
It is unclear whether the following construct is permitted (rejected by all compilers):
template <int>
struct S {} v;
This could be
- a class template with a declarator, which is forbidden by [temp.pre] p5, or
- a variable template which defines a class, which is not forbidden by any wording explicitly,
- both, simultaneously, in which case it is forbidden.
Suggestion resolution
If this construct is intended to be ill-formed, modify [temp.pre] p3 as follows:
A template-declaration is a declaration.
A declaration introduced by a template declaration of a variable is a variable template
-.
+, unless the decl-specifier-seq of the declaration contains a class-specifier.
A variable template at class scope is a static data member template.
If this construct is intended to be well-formed, modify [temp.pre] p5 as follows:
In a template-declaration, explicit specialization, or explicit instantiation
the init-declarator-list in the declaration shall contain at most one declarator.
-When such a declaration is used to declare a class template, no declarator is permitted.
Metadata
Metadata
Assignees
Labels
No labels