After
r16-6808-g4b0e94b394fa38, we started to ICE when the
std_attrs was error_mark_node. This fixes the problem by
checking if it was an error_mark_node before looking for
annotations.
Bootstrapped and tested on x86_64-linux-gnu with no regressions.
Changes since v1:
* v2: Move the check for error mark earlier.
* v3: small formating changes.
PR c++/124307
gcc/cp/ChangeLog:
* parser.cc (cp_parser_base_specifier): Check for
error mark like checking for non-nullness on the
attribute.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/alignas24.C: New test.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
tree std_attrs = cp_parser_std_attribute_spec_seq (parser);
tree annotations = NULL_TREE;
- if (std_attrs != NULL_TREE)
+ if (std_attrs != NULL_TREE && std_attrs != error_mark_node)
{
tree *pannotations = &annotations;
for (tree attr = std_attrs; attr; attr = TREE_CHAIN (attr))
--- /dev/null
+// PR c++/124307
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
+
+class : alignas // { dg-error "" }