* call.c (convert_like_real): Use similar_type_p in an assert.
* g++.dg/conversion/packed1.C: New test.
From-SVN: r276127
+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>
* name-lookup.c (check_extern_c_conflict): Use DECL_SOURCE_LOCATION.
tree type = TREE_TYPE (ref_type);
cp_lvalue_kind lvalue = lvalue_kind (expr);
- gcc_assert (same_type_ignoring_top_level_qualifiers_p
- (type, next_conversion (convs)->type));
+ gcc_assert (similar_type_p (type, next_conversion (convs)->type));
if (!CP_TYPE_CONST_NON_VOLATILE_P (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>
PR tree-optimization/91896
--- /dev/null
+// 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); }