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
This commit is contained in:
parent
25eafae67f
commit
05564120c6
@ -1,3 +1,9 @@
|
||||
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;
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
7
gcc/testsuite/g++.dg/warn/Waddress-of-packed-member2.C
Normal file
7
gcc/testsuite/g++.dg/warn/Waddress-of-packed-member2.C
Normal file
@ -0,0 +1,7 @@
|
||||
// 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" }
|
Loading…
Reference in New Issue
Block a user