gcc/testsuite/g++.dg/template/spec43.C
raw| 1 | // PR c++/115716 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | template <typename T> struct x { |
| 4 | template <typename U> struct y { // { dg-note "original" } |
| 5 | typedef T result2; |
| 6 | }; |
| 7 | }; |
| 8 | |
| 9 | template<> |
| 10 | template<typename U> |
| 11 | requires true |
| 12 | struct x<int>::y { // { dg-error "different constraints" } |
| 13 | typedef double result2; |
| 14 | }; |
| 15 | |
| 16 | int main() { |
| 17 | x<int>::y<int>::result2 xxx2; |
| 18 | } |