aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-03-25 21:06:09 +0100
committerJakub Jelinek <jakub@redhat.com>2021-03-25 21:06:09 +0100
commit0b86a6438191f720bebf880a2b932cd97d10229a (patch)
treefe2f1d624a8ddf0a5f1da8b784038ece1257a74e /gcc/cp/decl2.c
parent9efd72d28956eb79c7fca38e3c959733a3bb25bb (diff)
downloadgcc-0b86a6438191f720bebf880a2b932cd97d10229a.zip
gcc-0b86a6438191f720bebf880a2b932cd97d10229a.tar.gz
gcc-0b86a6438191f720bebf880a2b932cd97d10229a.tar.bz2
c++: Diagnose bare parameter packs in bitfield widths [PR99745]
The following invalid tests ICE because we don't diagnose (and drop) bare parameter packs in bitfield widths. 2021-03-25 Jakub Jelinek <jakub@redhat.com> PR c++/99745 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case. * g++.dg/cpp0x/variadic181.C: New test.
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index ef79f6c..a82960f 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1117,7 +1117,7 @@ grokbitfield (const cp_declarator *declarator,
&& !INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (width)))
error ("width of bit-field %qD has non-integral type %qT", value,
TREE_TYPE (width));
- else
+ else if (!check_for_bare_parameter_packs (width))
{
/* Temporarily stash the width in DECL_BIT_FIELD_REPRESENTATIVE.
check_bitfield_decl picks it from there later and sets DECL_SIZE