Title
template keyword for dependent template template arguments
Status
cd6
Section
13.3 [temp.names]
Submitter
Johannes Schaub

Created on 2012-03-10.00:00:00 last changed 28 months ago

Messages

Date: 2020-11-15.00:00:00

[Accepted at the November, 2020 meeting as part of paper P1787R6 and moved to DR at the February, 2021 meeting.]

According to 13.3 [temp.names] paragraph 4,

When the name of a member template specialization appears after . or -> in a postfix-expression or after a nested-name-specifier in a qualified-id, and the object expression of the postfix-expression is type-dependent or the nested-name-specifier in the qualified-id refers to a dependent type, but the name is not a member of the current instantiation (13.8.3.2 [temp.dep.type]), the member template name must be prefixed by the keyword template.

In other words, the template keyword is only required when forming a template-id. However, current compilers reject an example like:

  template<typename T, template<typename> class U = T::X> struct A;

and require the template keyword before X. Should the rule be amended to require the template keyword in cases like this?

History
Date User Action Args
2022-08-19 07:54:33adminsetstatus: drwp -> cd6
2021-02-24 00:00:00adminsetstatus: accepted -> drwp
2020-12-15 00:00:00adminsetstatus: drafting -> accepted
2012-11-03 00:00:00adminsetstatus: open -> drafting
2012-03-10 00:00:00admincreate