aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPeter Bergner <bergner@linux.ibm.com>2020-12-02 18:12:59 -0600
committerPeter Bergner <bergner@linux.ibm.com>2020-12-02 18:14:04 -0600
commit7e231b2cfbfa5f99bbf581555ca74eaaba42ad7f (patch)
treee216fa53843d68335b9922947b00af8b44b12e42 /gcc/cp
parent4ec9d0962371c134d881d7dcfcef5effc8ed847f (diff)
downloadgcc-7e231b2cfbfa5f99bbf581555ca74eaaba42ad7f.zip
gcc-7e231b2cfbfa5f99bbf581555ca74eaaba42ad7f.tar.gz
gcc-7e231b2cfbfa5f99bbf581555ca74eaaba42ad7f.tar.bz2
c++: Treat OPAQUE_TYPE types as an aggregate type [PR97947]
MODE_OPAQUE and the associated OPAQUE_TYPE were added to stop the optimizers from knowing how the bits in a variable with an opaque type are laid out. This makes them a kind of pseudo aggregate type and we need to treat them as such when we process the INIT initializer for variables with an opaque type. 2020-12-02 Peter Bergner <bergner@linux.ibm.com> gcc/cp/ PR c++/97947 * typeck2.c (digest_init_r): Handle OPAQUE_TYPE as an aggregate type. gcc/testsuite/ PR c++/97947 * g++.target/powerpc/pr97947.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/typeck2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 575c609..3fd2b17 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1150,6 +1150,7 @@ digest_init_r (tree type, tree init, int nested, int flags,
|| VECTOR_TYPE_P (type)
|| code == RECORD_TYPE
|| code == UNION_TYPE
+ || code == OPAQUE_TYPE
|| code == COMPLEX_TYPE);
/* "If T is a class type and the initializer list has a single