Commit 05564120 by Marek Polacek Committed by Marek Polacek

PR c++/89973 - -Waddress-of-packed-member ICE with invalid conversion.

	PR c++/89973 - -Waddress-of-packed-member ICE with invalid conversion. 
	* c-warn.c (check_address_or_pointer_of_packed_member): Check the type
	of RHS.

	* g++.dg/warn/Waddress-of-packed-member2.C: New test.

From-SVN: r270166
parent 25eafae6
2019-04-05 Marek Polacek <polacek@redhat.com>
PR c++/89973 - -Waddress-of-packed-member ICE with invalid conversion.
* c-warn.c (check_address_or_pointer_of_packed_member): Check the type
of RHS.
2019-04-03 Jason Merrill <jason@redhat.com>
PR c++/86586 - -fcompare-debug=-Wsign-compare.
......
......@@ -2769,7 +2769,7 @@ check_address_or_pointer_of_packed_member (tree type, tree rhs)
rhs = TREE_TYPE (rhs); /* Pointer type. */
rhs = TREE_TYPE (rhs); /* Function type. */
rhstype = TREE_TYPE (rhs);
if (!POINTER_TYPE_P (rhstype))
if (!rhstype || !POINTER_TYPE_P (rhstype))
return NULL_TREE;
rvalue = true;
}
......
2019-04-05 Marek Polacek <polacek@redhat.com>
PR c++/89973 - -Waddress-of-packed-member ICE with invalid conversion.
* g++.dg/warn/Waddress-of-packed-member2.C: New test.
2019-04-05 Richard Biener <rguenther@suse.de>
PR debug/89892
......
// PR c++/89973
// { dg-do compile { target c++14 } }
constexpr int a(); // { dg-warning "used but never defined" }
template <typename>
constexpr void *b = a(); // { dg-error "invalid conversion" }
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