diff options
author | Jason Merrill <jason@redhat.com> | 2009-11-12 18:21:33 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-11-12 18:21:33 -0500 |
commit | f208b768866fc84c28cf03e95d7c5d239a9d213e (patch) | |
tree | d8998b920c0b798056bed97bf686d0be44cbb70a /gcc/cp | |
parent | 3a2f6fac4d33120980e119665b7825ce23e30ce5 (diff) | |
download | gcc-f208b768866fc84c28cf03e95d7c5d239a9d213e.zip gcc-f208b768866fc84c28cf03e95d7c5d239a9d213e.tar.gz gcc-f208b768866fc84c28cf03e95d7c5d239a9d213e.tar.bz2 |
re PR c++/39560 (Erroneous warnings 'unused variable' in a templated class method with union)
PR c++/39560
* decl2.c (build_anon_union_vars): Set DECL_ARTIFICIAL.
From-SVN: r154133
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 333c84d..aa2563a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2009-11-12 Jason Merrill <jason@redhat.com> + PR c++/39560 + * decl2.c (build_anon_union_vars): Set DECL_ARTIFICIAL. + PR c++/37037 * decl.c (grokdeclarator): Don't generate a void PARM_DECL. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 510aa8f..7c3f7c05 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1313,6 +1313,7 @@ build_anon_union_vars (tree type, tree object) decl = build_decl (input_location, VAR_DECL, DECL_NAME (field), TREE_TYPE (field)); DECL_ANON_UNION_VAR_P (decl) = 1; + DECL_ARTIFICIAL (decl) = 1; base = get_base_address (object); TREE_PUBLIC (decl) = TREE_PUBLIC (base); |