Created on 2016-06-10.00:00:00 last changed 25 months ago
Additional note (February, 2022):
The paragraph in question was removed by P1815R2 (Translation-unit-local entities) (adopted 2020-02).
EWG 2022-11-11
Any change would require a paper.
Consider:
template <class F> F foo() { return 1; } template <class F> struct S { F foo() { return 1; } }; extern template int foo<int>(); extern template struct S<int>; int bar() { return foo<int>() + S<int>().foo(); }
An implementation is permitted to instantiate (and thus locally inline) S<int>::foo, but not S<int>, because 13.9.2 [temp.inst] paragraph 10 states:
Except for inline functions, declarations with types deduced from their initializer or return value (9.2.9.7 [dcl.spec.auto]), const variables of literal types, variables of reference types, and class template specializations, explicit instantiation declarations have the effect of suppressing the implicit instantiation of the entity to which they refer.
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-11-20 07:54:16 | admin | set | status: extension -> nad |
2022-02-18 07:47:23 | admin | set | messages: + msg6713 |
2018-02-27 00:00:00 | admin | set | status: open -> extension |
2016-06-10 00:00:00 | admin | create |