diff options
author | Mike Stump <mrs@apple.com> | 2004-07-09 18:49:04 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 2004-07-09 18:49:04 +0000 |
commit | 999a1ad4ec7212dc6ac0217750bcbbf86518c7db (patch) | |
tree | 4fc27f75faf22e9d883e4eb40f33c4250fcb5606 /gcc/cp | |
parent | 85fd2947bd37c39eb2b8b237359743ae0ecbb657 (diff) | |
download | gcc-999a1ad4ec7212dc6ac0217750bcbbf86518c7db.zip gcc-999a1ad4ec7212dc6ac0217750bcbbf86518c7db.tar.gz gcc-999a1ad4ec7212dc6ac0217750bcbbf86518c7db.tar.bz2 |
typeck.c (build_class_member_access_expr): Skip null deref warning when we don't dereference it.
* typeck.c (build_class_member_access_expr): Skip null deref
warning when we don't dereference it.
Radar 3718909
From-SVN: r84389
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3d194a4..01112d5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2004-07-09 Mike Stump <mrs@apple.com> + + * typeck.c (build_class_member_access_expr): Skip null deref + warning when we don't dereference it. + 2004-07-09 Giovanni Bajo <giovannibajo@gcc.gnu.org> PR c++/8211 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 55b3ef3..6b11325 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -1707,7 +1707,8 @@ build_class_member_access_expr (tree object, tree member, actually used the offsetof macro, since there's no way to know at this point. So we just give a warning, instead of a pedwarn. */ if (null_object_p && warn_invalid_offsetof - && CLASSTYPE_NON_POD_P (object_type)) + && CLASSTYPE_NON_POD_P (object_type) + && ! skip_evaluation) { warning ("invalid access to non-static data member `%D' of NULL object", member); |