Skip to content

Commit f1e1301

Browse files
committed
CWG3111 Template parameter objects of array type
1 parent df06f46 commit f1e1301

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

source/meta.tex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4124,6 +4124,10 @@
41244124
\begin{codeblock}
41254125
if constexpr (is_annotation(@$R$@)) {
41264126
return @$C$@;
4127+
} else if constexpr (is_array_type(type_of(@$R$@))) {
4128+
return reflect_constant_array([: @$R$@ :]);
4129+
} else if constexpr (is_function_type(type_of(@$R$@))) {
4130+
return reflect_function([: @$R$@ :]);
41274131
} else {
41284132
return reflect_constant([: @$R$@ :]);
41294133
}

source/templates.tex

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,21 @@
496496
\end{itemize}
497497

498498
\pnum
499+
Certain constructs refer to template parameter objects,
500+
which are distinct objects with static storage duration and non-volatile const type.
501+
No two such objects have template-argument-equivalent values\iref{temp.type}.
499502
An \grammarterm{id-expression} naming
500503
a constant template parameter of class type \tcode{T}
501-
denotes a static storage duration object of type \tcode{const T},
502-
known as a \defn{template parameter object},
503-
which is template-argument-equivalent\iref{temp.type} to
504+
denotes the template parameter object of type \tcode{const T},
505+
which is template-argument-equivalent to
504506
the corresponding template argument
505507
after it has been converted
506508
to the type of the template parameter\iref{temp.arg.nontype}.
507-
No two template parameter objects are template-argument-equivalent.
509+
\begin{note}
510+
There can be template parameter objects of array type\iref{meta.define.static},
511+
but such an object is never denoted by an \grammarterm{id-expression}
512+
that names a constant template parameter.
513+
\end{note}
508514
\begin{note}
509515
If an \grammarterm{id-expression} names
510516
a non-reference constant template parameter,

0 commit comments

Comments
 (0)