diff options
author | Ollie Wild <aaw@google.com> | 2007-05-22 21:05:01 +0000 |
---|---|---|
committer | Ollie Wild <aaw@gcc.gnu.org> | 2007-05-22 21:05:01 +0000 |
commit | 8e89cbfe6cfa70ebe7978bf635111dc307b19f56 (patch) | |
tree | f6b49ec02c025097ff133b034f790ab8364dfef5 /gcc/testsuite | |
parent | 6b12f000e0879e171ce0a7677291a9417d014221 (diff) | |
download | gcc-8e89cbfe6cfa70ebe7978bf635111dc307b19f56.zip gcc-8e89cbfe6cfa70ebe7978bf635111dc307b19f56.tar.gz gcc-8e89cbfe6cfa70ebe7978bf635111dc307b19f56.tar.bz2 |
name-lookup.c (ambiguous_decl): Adds check for hidden types.
* name-lookup.c (ambiguous_decl): Adds check for hidden types.
(unqualified_namespace_lookup): Adds check for hidden types.
* g++.dg/lookup/hidden-class10.C: New test.
* g++.dg/lookup/hidden-class11.C: New test.
From-SVN: r124963
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/hidden-class10.C | 11 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/hidden-class11.C | 23 |
3 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 77b6a7f..189d5ff 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2007-05-22 Ollie Wild <aaw@google.com> + * g++.dg/lookup/hidden-class10.C: New test. + * g++.dg/lookup/hidden-class11.C: New test. + +2007-05-22 Ollie Wild <aaw@google.com> + * g++.dg/lookup/name-clash5.C: New test. * g++.dg/lookup/name-clash6.C: New test. diff --git a/gcc/testsuite/g++.dg/lookup/hidden-class10.C b/gcc/testsuite/g++.dg/lookup/hidden-class10.C new file mode 100644 index 0000000..f68196f --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/hidden-class10.C @@ -0,0 +1,11 @@ +// Copyright (C) 2007 Free Software Foundation +// Contributed by Ollie Wild <aaw@google.com> +// { dg-do compile } + +// Verify that a friend class is hidden even if it overrides a builtin +// function name. + +class A { + friend class abort; + abort *b; // { dg-error "no type|expected" } +}; diff --git a/gcc/testsuite/g++.dg/lookup/hidden-class11.C b/gcc/testsuite/g++.dg/lookup/hidden-class11.C new file mode 100644 index 0000000..8432e32 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/hidden-class11.C @@ -0,0 +1,23 @@ +// Copyright (C) 2007 Free Software Foundation +// Contributed by Ollie Wild <aaw@google.com> +// { dg-do compile } + +// Verify that a friend class is hidden even if it is hidden by a non-builtin +// function name. + +namespace M { + void F (void); + class F; +} + +namespace N { + void F(void); + class A { + friend class F; + }; +} + +using namespace M; +using namespace N; + +class F *b; |