Annex A (informative) Grammar summary [gram]

A.12 Templates [gram.temp]

template-declaration:
	template-head declaration
	template-head concept-definition
template-head:
	template < template-parameter-list > requires-clause
template-parameter-list:
	template-parameter
	template-parameter-list , template-parameter
requires-clause:
	requires constraint-logical-or-expression
constraint-logical-or-expression:
	constraint-logical-and-expression
	constraint-logical-or-expression || constraint-logical-and-expression
constraint-logical-and-expression:
	primary-expression
	constraint-logical-and-expression && primary-expression
concept-definition:
	concept concept-name = constraint-expression ;
concept-name:
	identifier
template-parameter:
	type-parameter
	parameter-declaration
	constrained-parameter
type-parameter:
	type-parameter-key ... identifier
	type-parameter-key identifier = type-id
	template < template-parameter-list > type-parameter-key ... identifier
	template < template-parameter-list > type-parameter-key identifier = id-expression
type-parameter-key:
	class
	typename
constrained-parameter:
	qualified-concept-name ... identifier
	qualified-concept-name identifier default-template-argument
qualified-concept-name:
	nested-name-specifier concept-name
	nested-name-specifier partial-concept-id
partial-concept-id:
	concept-name < template-argument-list >
default-template-argument:
	= type-id
	= id-expression
	= initializer-clause
simple-template-id:
	template-name < template-argument-list >
template-id:
	simple-template-id
	operator-function-id < template-argument-list >
	literal-operator-id < template-argument-list >
template-name:
	identifier
template-argument-list:
	template-argument ...
	template-argument-list , template-argument ...
template-argument:
	constant-expression
	type-id
	id-expression
constraint-expression:
	logical-or-expression
typename-specifier:
	typename nested-name-specifier identifier
	typename nested-name-specifier template simple-template-id
explicit-instantiation:
	extern template declaration
explicit-specialization:
	template < > declaration
deduction-guide:
	explicit template-name ( parameter-declaration-clause ) -> simple-template-id ;