diff options
| -rw-r--r-- | gcc/cp/semantics.c | 7 | ||||
| -rw-r--r-- | gcc/testsuite/g++.dg/cpp2a/concepts-decltype3.C | 15 |
2 files changed, 16 insertions, 6 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index df698d5..0389198 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3006,12 +3006,7 @@ finish_compound_literal (tree type, tree compound_literal, /* If we're in a template, return the original compound literal. */ if (orig_cl) - { - if (!VECTOR_TYPE_P (type)) - return get_target_expr_sfinae (orig_cl, complain); - else - return orig_cl; - } + return orig_cl; if (TREE_CODE (compound_literal) == CONSTRUCTOR) { diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-decltype3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-decltype3.C new file mode 100644 index 0000000..837855c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-decltype3.C @@ -0,0 +1,15 @@ +// { dg-do compile { target c++20 } } + +template <class T> concept C = requires(T t) { t; }; + +template <class T> using A = decltype((T{}, int{})); + +template <class T> concept D = C<A<T>>; + +template <class T, class U> void f() requires D<T>; +template <class T> void g() requires D<T>; + +void h() { + f<int, int>(); + g<int>(); +} |
