]> gcc.gnu.org Git - gcc.git/commitdiff
typeck.c (lookup_anon_field): Cope with qv qualifiers.
authorNathan Sidwell <nathan@codesourcery.com>
Wed, 15 Nov 2000 11:59:07 +0000 (11:59 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 15 Nov 2000 11:59:07 +0000 (11:59 +0000)
cp/
* typeck.c (lookup_anon_field): Cope with qv qualifiers.
testsuite/
* g++.old-deja/g++.other/anon5.C: New test.

From-SVN: r37478

gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/anon5.C [new file with mode: 0644]

index 6589da1d997125a8d715796ec1bb1d6292d8a6a2..881ad2b4fada5d1152bc7bd55bade02cf09c5ba8 100644 (file)
@@ -1,3 +1,7 @@
+2000-11-15  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * typeck.c (lookup_anon_field): Cope with qv qualifiers.
+
 2000-11-14  Mark Mitchell  <mark@codesourcery.com>
 
        * class.c (build_vtbl_initializer): Fix typo in comment.
index eca1c292515df977c9657a5a23e511cd576e1a59..d0ca2bbcb28696be6538a7caa05f9a73fc815841 100644 (file)
@@ -1994,7 +1994,7 @@ lookup_anon_field (t, type)
 
       /* If we find it directly, return the field.  */
       if (DECL_NAME (field) == NULL_TREE
-         && type == TREE_TYPE (field))
+         && type == TYPE_MAIN_VARIANT (TREE_TYPE (field)))
        {
          return field;
        }
index 730bb0da6ecc366a1ae95882b92eae99e9b135b2..6a01b9243a1d371781ec1493ce7c34111ce04db4 100644 (file)
@@ -1,3 +1,7 @@
+2000-11-15  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * g++.old-deja/g++.other/anon5.C: New test.
+
 2000-11-14  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * gcc.dg/c90-const-expr-2.c, gcc.dg/c99-const-expr-2.c: Add more
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon5.C b/gcc/testsuite/g++.old-deja/g++.other/anon5.C
new file mode 100644 (file)
index 0000000..69fafda
--- /dev/null
@@ -0,0 +1,17 @@
+// Build don't link:
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Nov 2000 <nathan@codesourcery.com>
+
+// Bug 649. A cv qualified anonymous union would cause confusion.
+
+struct X
+{
+  int fn () const
+  {
+    return member;
+  }
+  const union
+  {
+    int member;
+  };
+};
This page took 0.096787 seconds and 5 git commands to generate.