File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 7173
7173
inside \tcode {sizeof}, \tcode {decltype}, and other contexts that allow non-constant
7174
7174
expressions. The substitution proceeds in lexical order and stops when
7175
7175
a condition that causes deduction to fail is encountered.
7176
+ If substitution into different declarations of the same function template would
7177
+ cause template instantiations to occur in a different order or not at all,
7178
+ the program is ill-formed; no diagnostic required.
7176
7179
\begin {note }
7177
7180
The equivalent substitution in exception specifications is
7178
7181
done only when the \grammarterm {noexcept-specifier} is instantiated,
7186
7189
template <class T> void f(...) { }
7187
7190
template <class T> auto g(typename A<T>::X) -> typename T::X;
7188
7191
template <class T> void g(...) { }
7192
+ template <class T> typename T::X h(typename A<T>::X);
7193
+ template <class T> auto h(typename A<T>::X) -> typename T::X; // redeclaration
7194
+ template <class T> void h(...) { }
7189
7195
7190
- void h () {
7196
+ void x () {
7191
7197
f<int>(0); // OK, substituting return type causes deduction to fail
7192
7198
g<int>(0); // error, substituting parameter type instantiates \tcode {A<int>}
7199
+ h<int>(0); // ill-formed, no diagnostic required
7193
7200
}
7194
7201
\end {codeblock }
7195
7202
\end {example }
You can’t perform that action at this time.
0 commit comments