gcc/testsuite/g++.dg/cpp1z/class-deduction85.C
raw| 1 | // PR c++/99885 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | |
| 4 | template <auto const& A> |
| 5 | struct Foo {}; |
| 6 | |
| 7 | template <auto const& A> |
| 8 | struct Bar { |
| 9 | constexpr auto foo() const -> Foo<A> { |
| 10 | return {}; |
| 11 | } |
| 12 | }; |
| 13 | |
| 14 | constexpr int a = 1; |
| 15 | constexpr Bar<a> bar; |
| 16 | Foo foo = bar.foo(); // <-- CTAD failure |