aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-11-12 18:21:33 -0500
committerJason Merrill <jason@gcc.gnu.org>2009-11-12 18:21:33 -0500
commitf208b768866fc84c28cf03e95d7c5d239a9d213e (patch)
treed8998b920c0b798056bed97bf686d0be44cbb70a /gcc/cp
parent3a2f6fac4d33120980e119665b7825ce23e30ce5 (diff)
downloadgcc-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/ChangeLog3
-rw-r--r--gcc/cp/decl2.c1
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);