2016-09-20 Jakub Jelinek <jakub@redhat.com>
+ PR c++/77626
+ * constexpr.c (cxx_fold_indirect_ref): Don't call byte_position on
+ FIELD_DECLs with error_mark_node type. Remove useless break; after
+ return.
+
PR c++/77638
* parser.c (cp_parser_template_declaration_after_parameter): For 2
argument operator"" template set ok to false for
tree field = TYPE_FIELDS (optype);
for (; field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
+ && TREE_TYPE (field) != error_mark_node
&& integer_zerop (byte_position (field))
&& (same_type_ignoring_top_level_qualifiers_p
(TREE_TYPE (field), type)))
- {
- return fold_build3 (COMPONENT_REF, type, op, field, NULL_TREE);
- break;
- }
+ return fold_build3 (COMPONENT_REF, type, op, field, NULL_TREE);
}
}
else if (TREE_CODE (sub) == POINTER_PLUS_EXPR
tree field = TYPE_FIELDS (op00type);
for (; field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
+ && TREE_TYPE (field) != error_mark_node
&& tree_int_cst_equal (byte_position (field), op01)
&& (same_type_ignoring_top_level_qualifiers_p
(TREE_TYPE (field), type)))
- {
- return fold_build3 (COMPONENT_REF, type, op00,
- field, NULL_TREE);
- break;
- }
+ return fold_build3 (COMPONENT_REF, type, op00,
+ field, NULL_TREE);
}
}
}