diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-03-12 14:57:56 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-03-12 14:57:56 -0500 |
commit | 28750ac2765e808aa4f45a73c630e53575834efd (patch) | |
tree | 16a6f9a9b38211da1405e4e388b76c48f7bc4f81 /gcc/testsuite/g++.dg/concepts | |
parent | 80fcc4b6afee72443bef551064826b3b4b6785e6 (diff) | |
download | gcc-28750ac2765e808aa4f45a73c630e53575834efd.zip gcc-28750ac2765e808aa4f45a73c630e53575834efd.tar.gz gcc-28750ac2765e808aa4f45a73c630e53575834efd.tar.bz2 |
c++: give fold expressions a location
This improves diagnostic quality for unsatisfied atomic constraints
that consist of a fold expression, e.g. in concepts/diagnostic3.C
the "evaluated to false" diagnostic now points to the expression:
.../diagnostic3.C:10:22: note: the expression ‘(foo<Ts> && ...) [with Ts = {int, char}]’ evaluated to ‘false’
10 | requires (foo<Ts> && ...)
| ~~~~~~~~~~~~^~~~
gcc/cp/ChangeLog:
* semantics.cc (finish_unary_fold_expr): Use input_location
instead of UNKNOWN_LOCATION.
(finish_binary_fold_expr): Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/concepts/diagnostic3.C: Adjusted expected location of
"evaluated to false" diagnostics.
Diffstat (limited to 'gcc/testsuite/g++.dg/concepts')
-rw-r--r-- | gcc/testsuite/g++.dg/concepts/diagnostic3.C | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/testsuite/g++.dg/concepts/diagnostic3.C b/gcc/testsuite/g++.dg/concepts/diagnostic3.C index 7796e26..410651a 100644 --- a/gcc/testsuite/g++.dg/concepts/diagnostic3.C +++ b/gcc/testsuite/g++.dg/concepts/diagnostic3.C @@ -7,18 +7,18 @@ template<typename T> concept foo = (bool)(foo_v<T> | foo_v<T&>); template<typename... Ts> -requires (foo<Ts> && ...) +requires (foo<Ts> && ...) // { dg-message "with Ts = .int, char... evaluated to .false." } void -bar() // { dg-message "with Ts = .int, char... evaluated to .false." } +bar() { } template<int> struct S { }; template<int... Is> -requires (foo<S<Is>> && ...) +requires (foo<S<Is>> && ...) // { dg-message "with Is = .2, 3, 4... evaluated to .false." } void -baz() // { dg-message "with Is = .2, 3, 4... evaluated to .false." } +baz() { } void |