template<typename I> void f() { using S = signed char; constexpr const S v[]{0}; } int main() { f<int>(); } a.cc: In instantiation of 'void f() [with I = int]': a.cc:10:9: required from here a.cc:5:20: internal compiler error: in tsubst_copy, at cp/pt.c:16155 5 | constexpr const S v[]{0}; | ^
Confirmed.
Started with r263511.
GCC 9.2 has been released.
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>: https://gcc.gnu.org/g:8f25c39c454d7d3d323edf014a653649946352bd commit r10-6266-g8f25c39c454d7d3d323edf014a653649946352bd Author: Jason Merrill <jason@redhat.com> Date: Sun Jan 26 22:19:47 2020 -0500 c++: Fix array of char typedef in template (PR90966). Since Martin Sebor's patch for PR 71625 to change braced array initializers to STRING_CST in some cases, we need to be ready for STRING_CST with types that are changed by tsubst. fold_convert doesn't know how to deal with STRING_CST, which is reasonable; we really shouldn't expect it to here. So let's handle STRING_CST separately. PR c++/90966 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
The releases/gcc-9 branch has been updated by Jason Merrill <jason@gcc.gnu.org>: https://gcc.gnu.org/g:dcb23017b1a9f65a81dbbe0f2b1a42999f7b2ac7 commit r9-8184-gdcb23017b1a9f65a81dbbe0f2b1a42999f7b2ac7 Author: Jason Merrill <jason@redhat.com> Date: Sun Jan 26 22:19:47 2020 -0500 c++: Fix array of char typedef in template (PR90966). Since Martin Sebor's patch for PR 71625 to change braced array initializers to STRING_CST in some cases, we need to be ready for STRING_CST with types that are changed by tsubst. fold_convert doesn't know how to deal with STRING_CST, which is reasonable; we really shouldn't expect it to here. So let's handle STRING_CST separately. PR c++/90966 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
*** Bug 92625 has been marked as a duplicate of this bug. ***
Fixed for GCC 9.3 and 10.