From: Richard Biener Date: Fri, 19 Nov 2021 07:54:18 +0000 (+0100) Subject: c++/103326 - fix ICE in tsubst with VECTOR_CST X-Git-Tag: basepoints/gcc-13~2915 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd85c42c36a5d4e00b41ed40bca98598a2fb57c5;p=thirdparty%2Fgcc.git c++/103326 - fix ICE in tsubst with VECTOR_CST This adds missing handling of VECTOR_CST. 2021-11-19 Richard Biener PR c++/103326 * pt.c (tsubst_copy): Handle VECTOR_CST. * g++.dg/pr103326.C: New testcase. --- diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 6a2a93776484..22798b91608e 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -17254,6 +17254,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) case INTEGER_CST: case REAL_CST: case COMPLEX_CST: + case VECTOR_CST: { /* Instantiate any typedefs in the type. */ tree type = tsubst (TREE_TYPE (t), args, complain, in_decl); diff --git a/gcc/testsuite/g++.dg/pr103326.C b/gcc/testsuite/g++.dg/pr103326.C new file mode 100644 index 000000000000..260e7da86e8b --- /dev/null +++ b/gcc/testsuite/g++.dg/pr103326.C @@ -0,0 +1,15 @@ +// { dg-do compile } +// { dg-require-effective-target c++11 } + +using x86_64_v16qi [[gnu::__vector_size__ (16)]] = char; + +template +void foo() +{ + constexpr x86_64_v16qi zero{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +} + +void foo2() +{ + foo(); +}