Commit b134cab0 by Marek Polacek Committed by Marek Polacek

PR c++/91877 - ICE with converting member of packed struct.

	* call.c (convert_like_real): Use similar_type_p in an assert.

	* g++.dg/conversion/packed1.C: New test.

From-SVN: r276127
parent 9a3afc35
2019-09-25 Marek Polacek <polacek@redhat.com>
PR c++/91877 - ICE with converting member of packed struct.
* call.c (convert_like_real): Use similar_type_p in an assert.
2019-09-25 Paolo Carlini <paolo.carlini@oracle.com> 2019-09-25 Paolo Carlini <paolo.carlini@oracle.com>
* name-lookup.c (check_extern_c_conflict): Use DECL_SOURCE_LOCATION. * name-lookup.c (check_extern_c_conflict): Use DECL_SOURCE_LOCATION.
......
...@@ -7382,8 +7382,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, ...@@ -7382,8 +7382,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
tree type = TREE_TYPE (ref_type); tree type = TREE_TYPE (ref_type);
cp_lvalue_kind lvalue = lvalue_kind (expr); cp_lvalue_kind lvalue = lvalue_kind (expr);
gcc_assert (same_type_ignoring_top_level_qualifiers_p gcc_assert (similar_type_p (type, next_conversion (convs)->type));
(type, next_conversion (convs)->type));
if (!CP_TYPE_CONST_NON_VOLATILE_P (type) if (!CP_TYPE_CONST_NON_VOLATILE_P (type)
&& !TYPE_REF_IS_RVALUE (ref_type)) && !TYPE_REF_IS_RVALUE (ref_type))
{ {
......
2019-09-25 Marek Polacek <polacek@redhat.com>
PR c++/91877 - ICE with converting member of packed struct.
* g++.dg/conversion/packed1.C: New test.
2019-09-25 Richard Biener <rguenther@suse.de> 2019-09-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/91896 PR tree-optimization/91896
......
// PR c++/91877 - ICE with converting member of packed struct.
// { dg-do compile { target c++11 } }
// { dg-options "-fpack-struct" }
template <typename a> class b {
public:
b(const a &);
};
struct {
int *c;
} d;
void e() { b<const int *>(d.c); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment