On Thu, Jun 14, 2018 at 12:51 PM, Marek Polacek <pola...@redhat.com> wrote: > On Mon, Jun 11, 2018 at 03:00:04PM -0400, Jason Merrill wrote: >> On Wed, Jun 6, 2018 at 5:18 PM, Marek Polacek <pola...@redhat.com> wrote: >> > We crash on this testcase containing a bogus attribute, because >> > cp_check_const_attributes accessed TREE_VALUE of a tree that happened to be >> > expr_pack_expansion. Since here we're merely trying to evaluate constexpr >> > arguments, I thought we could skip such bogus arguments. >> >> Hmm, attributes should always be a TREE_LIST, lots of places assume >> that. Why isn't the pack expansion wrapped in a TREE_LIST? > > I believe you did that on purpose. There pack comes from > cp_parser_std_attribute_list. We could wrap it into a TREE_LIST, but then > tsubst_attribute would have to be tweaked to handle the pack expansion > correctly.
How so? tsubst_attribute expects to find a pack expansion in the TREE_VALUE of a TREE_LIST. And cp_parser_std_attribute_list puts the pack expansion in TREE_VALUE. Jason