diff options
author | Jason Merrill <jason@redhat.com> | 2020-06-02 16:23:02 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-06-03 14:06:17 -0400 |
commit | ef4e0c35546ba2c897613925c1d2485603ca3ab1 (patch) | |
tree | 5d209b6ffdcdb2555a52c17ce15c951e398e332f /gcc/tree-streamer-in.c | |
parent | 8d57c30611b05a89fd265f6c0a74fe829c21cd34 (diff) | |
download | gcc-ef4e0c35546ba2c897613925c1d2485603ca3ab1.zip gcc-ef4e0c35546ba2c897613925c1d2485603ca3ab1.tar.gz gcc-ef4e0c35546ba2c897613925c1d2485603ca3ab1.tar.bz2 |
c++: Fix VLA in template [PR95232]
In a non-template, grokdeclarator notices when we build a pointer to a
variably-modified type, and inserts a TYPE_DECL to make sure that type gets
gimplified. But in a template we can't always recognize a variably-modified
type, so we need to deal with it at instantiation time.
gcc/cp/ChangeLog:
PR c++/95232
* cp-tree.h (predeclare_vla): Declare.
* cp-gimplify.c (predeclare_vla): Handle getting a decl.
* pt.c (tsubst_expr) [DECL_EXPR]: Use it.
gcc/testsuite/ChangeLog:
PR c++/95232
* g++.dg/ubsan/vla-2.C: New test.
Diffstat (limited to 'gcc/tree-streamer-in.c')
0 files changed, 0 insertions, 0 deletions