Created on 2015-03-17.00:00:00 last changed 94 months ago
Proposed resolution (September, 2015):
Delete 13.4.2 [temp.arg.type] paragraph 3:
If a declaration acquires a function type through a type dependent on a template-parameter and this causes a declaration that does not use the syntactic form of a function declarator to have function type, the program is ill-formed. [Example:template<class T> struct A { static T t; }; typedef int function(); A<function> a; // ill-formed: would declare A<function>::t // as a static member function
—end example]
...X<int> has a static member s of type int and X<char*> has a static member s of type char*. —end example]
If a function declaration acquired its function type through a dependent type (13.8.3.2 [temp.dep.type]) without using the syntactic form of a function declaator, the program is ill-formed. [Example:
template<class T> struct A { static T t; }; typedef int function(); A<function> a; // ill-formed: would declare A<function>::t // as a static member function—end example]
[Adopted at the February, 2016 meeting.]
According to 13.4.2 [temp.arg.type] paragraph 3,
If a declaration acquires a function type through a type dependent on a template-parameter and this causes a declaration that does not use the syntactic form of a function declarator to have function type, the program is ill-formed.
This is not clear enough regarding which declarations are in view. For example, does it apply to a typedef declaration? Does it apply to a parameter declaration, where normal function-to-pointer decay would apply? There is implementation variance at block scope.
Also, since this applies a restriction to the usage of dependent types, not template type arguments per se, the paragraph presumably should appear in 13.8.3.2 [temp.dep.type] and not its current location.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: tentatively ready -> cd4 |
2015-11-10 00:00:00 | admin | set | messages: + msg5608 |
2015-11-10 00:00:00 | admin | set | status: drafting -> tentatively ready |
2015-03-17 00:00:00 | admin | create |