diff options
-rw-r--r-- | gcc/cp/decl2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/variadic181.C | 9 |
2 files changed, 10 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 diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic181.C b/gcc/testsuite/g++.dg/cpp0x/variadic181.C new file mode 100644 index 0000000..0bb6fe7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic181.C @@ -0,0 +1,9 @@ +// PR c++/99745 +// { dg-do compile { target c++11 } } + +template <typename... Ts> +struct S { int a : sizeof(Ts); }; // { dg-error "parameter packs not expanded with '\.\.\.':" } +S<int> s; // { dg-message "'Ts'" "" { target *-*-* } .-1 } +template <int... Ns> +struct T { int a : Ns; }; // { dg-error "parameter packs not expanded with '\.\.\.':" } +T<0> t; // { dg-message "'Ns'" "" { target *-*-* } .-1 } |