aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorPeter Bergner <bergner@linux.ibm.com>2022-06-17 23:43:23 -0500
committerPeter Bergner <bergner@linux.ibm.com>2022-07-26 10:04:44 -0500
commit975658b782f36dcf6eb190966d5b705977bfd5eb (patch)
tree34cf4546577b46404d91bf0f6c5a969369ee148e /gcc/expr.cc
parent5b96c823e591980a80481eb3fe72092a6146f742 (diff)
downloadgcc-975658b782f36dcf6eb190966d5b705977bfd5eb.zip
gcc-975658b782f36dcf6eb190966d5b705977bfd5eb.tar.gz
gcc-975658b782f36dcf6eb190966d5b705977bfd5eb.tar.bz2
c: Handle initializations of opaque types [PR106016]
The initial commit that added opaque types thought that there couldn't be any valid initializations for variables of these types, but the test case in the bug report shows that isn't true. The solution is to handle OPAQUE_TYPE initializations like the other scalar types. 2022-06-17 Peter Bergner <bergner@linux.ibm.com> gcc/ PR c/106016 * expr.cc (count_type_elements): Handle OPAQUE_TYPE. gcc/testsuite/ PR c/106016 * gcc.target/powerpc/pr106016.c: New test.
Diffstat (limited to 'gcc/expr.cc')
-rw-r--r--gcc/expr.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/expr.cc b/gcc/expr.cc
index f9753d4..80bb1b8 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -6462,13 +6462,13 @@ count_type_elements (const_tree type, bool for_ctor_p)
case OFFSET_TYPE:
case REFERENCE_TYPE:
case NULLPTR_TYPE:
+ case OPAQUE_TYPE:
return 1;
case ERROR_MARK:
return 0;
case VOID_TYPE:
- case OPAQUE_TYPE:
case METHOD_TYPE:
case FUNCTION_TYPE:
case LANG_TYPE: