diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6589da1d997..881ad2b4fad 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2000-11-15 Nathan Sidwell + + * typeck.c (lookup_anon_field): Cope with qv qualifiers. + 2000-11-14 Mark Mitchell * class.c (build_vtbl_initializer): Fix typo in comment. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index eca1c292515..d0ca2bbcb28 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 730bb0da6ec..6a01b9243a1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2000-11-15 Nathan Sidwell + + * g++.old-deja/g++.other/anon5.C: New test. + 2000-11-14 Joseph S. Myers * 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 00000000000..69fafdae182 --- /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 + +// Bug 649. A cv qualified anonymous union would cause confusion. + +struct X +{ + int fn () const + { + return member; + } + const union + { + int member; + }; +};