gcc/testsuite/g++.dg/concepts/pr92804-2.C
raw| 1 | // { dg-do compile { target c++17 } } |
| 2 | // { dg-options "-fconcepts" } |
| 3 | |
| 4 | template<typename T> |
| 5 | concept foo = true; // { dg-message "declared here" } |
| 6 | |
| 7 | template<typename T> |
| 8 | void bar(T t) |
| 9 | { |
| 10 | if constexpr (foo<T>::value) // { dg-error "17:concept-id .foo<T>. in nested-name-specifier" } |
| 11 | // { dg-error "expected|value" "" { target *-*-* } .-1 } |
| 12 | { |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | int main() |
| 17 | { |
| 18 | bar(1); |
| 19 | } |