diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-11-15 11:59:07 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-11-15 11:59:07 +0000 |
commit | 71631a1f1ce6cba9b823cb48a2bff17e97e2664f (patch) | |
tree | b6ff16dc9d8af462973b8cea045e7c79c3d7b84a | |
parent | eab0c1ab23e6ab6f37af519150a22f6b3129c452 (diff) | |
download | gcc-71631a1f1ce6cba9b823cb48a2bff17e97e2664f.zip gcc-71631a1f1ce6cba9b823cb48a2bff17e97e2664f.tar.gz gcc-71631a1f1ce6cba9b823cb48a2bff17e97e2664f.tar.bz2 |
typeck.c (lookup_anon_field): Cope with qv qualifiers.
cp/
* typeck.c (lookup_anon_field): Cope with qv qualifiers.
testsuite/
* g++.old-deja/g++.other/anon5.C: New test.
From-SVN: r37478
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/anon5.C | 17 |
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6589da1..881ad2b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index eca1c29..d0ca2bb 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 730bb0d..6a01b92 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..69fafda --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/anon5.C @@ -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; + }; +}; |