diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-11-06 01:07:50 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-11-06 01:07:50 +0100 |
commit | a75de6923043978eb7d96d79a28ba7becea353e9 (patch) | |
tree | a6ebd61fe15b0d819dbd87fef8138e1bb10989e0 /gcc/c-decl.c | |
parent | c3928dde21846d4572238317390613c8bcb042b6 (diff) | |
download | gcc-a75de6923043978eb7d96d79a28ba7becea353e9.zip gcc-a75de6923043978eb7d96d79a28ba7becea353e9.tar.gz gcc-a75de6923043978eb7d96d79a28ba7becea353e9.tar.bz2 |
re PR c/44772 (-Wc++-compat warns incorrectly for anonymous unions)
PR c/44772
* c-decl.c (warn_cxx_compat_finish_struct): Don't call
pointer_set_contains if DECL_NAME is NULL.
* gcc.dg/Wcxx-compat-21.c: New test.
From-SVN: r166384
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index bb7cf64..7d27dfe 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6877,7 +6877,8 @@ warn_cxx_compat_finish_struct (tree fieldlist) for (x = fieldlist; x != NULL_TREE; x = DECL_CHAIN (x)) { - if (pointer_set_contains (tset, DECL_NAME (x))) + if (DECL_NAME (x) != NULL_TREE + && pointer_set_contains (tset, DECL_NAME (x))) { warning_at (DECL_SOURCE_LOCATION (x), OPT_Wc___compat, ("using %qD as both field and typedef name is " |