[diff.cpp23.temp]

# Annex C (informative) Compatibility [[diff]](./#diff)

## C.1 C++ and ISO C++ 2023 [[diff.cpp23]](diff.cpp23#temp)

### C.1.5 [[temp]](temp "13 Templates"): templates [diff.cpp23.temp]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/compatibility.tex#L185)

**Affected subclause:** [[temp.constr]](temp.constr)  


**Change:** Some atomic constraints become fold expanded constraints[.](#1.sentence-1)

  


**Rationale:** Permit the subsumption of fold expressions[.](#1.sentence-2)

  


**Effect on original feature:** Valid C++ 2023 code may become ill-formed[.](#1.sentence-3)

[*Example [1](#example-1)*: template <typename ...V> struct A;struct S {static constexpr int compare(const S&) { return 1; }};

template <typename ...T, typename ...U>void f(A<T ...> *, A<U ...> *)requires (T::compare(U{}) && ...); // was well-formed (atomic constraint of type bool),// now ill-formed (results in an atomic constraint of type int)void g(A<S, S> *ap) { f(ap, ap);} â *end example*]

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/compatibility.tex#L209)

**Affected subclause:** [[temp.deduct.call]](temp.deduct.call)  


**Change:** Template argument deduction from overload sets succeeds in more cases[.](#2.sentence-1)

  


**Rationale:** Allow consideration of constraints to disambiguate overload sets
used as parameters in function calls[.](#2.sentence-2)

  


**Effect on original feature:** Valid C++ 2023 code may become ill-formed[.](#2.sentence-3)

[*Example [2](#example-2)*: template <typename T>void f(T &&, void (*)(T &&));

void g(int &); // #1inline namespace A {void g(short &&); // #2}inline namespace B {void g(short &&); // #3}void q() {int x;
 f(x, g); // ill-formed; previously well-formed, deducing T = int&}

There is no change to the applicable deduction rules for
the individual g candidates:
Type deduction from #1 does not succeed;
type deductions from #2 and #3 both succeed[.](#2.sentence-4)

â *end example*]
