diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-28 00:47:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-28 00:47:05 +0000 |
commit | 505ad49a093838d84cb213849c75c1d7d62374aa (patch) | |
tree | 13aa50b4c5650ba5c73c8786e2f5a6e8d80e0dcd /clang/test/SemaCXX/using-decl-1.cpp | |
parent | 08d86dac71d4c1c3e6d2e44a3abe5a0581fac735 (diff) | |
download | bcm5719-llvm-505ad49a093838d84cb213849c75c1d7d62374aa.tar.gz bcm5719-llvm-505ad49a093838d84cb213849c75c1d7d62374aa.zip |
Teach Sema::isDeclInScope to handle overload sets constructed from
functions that occur in multiple declaration contexts, e.g., because
some were found via using declarations. Now, isDeclInScope will build
a new overload set (when needed) containing only those declarations
that are actually in scope. This eliminates a problem found with
libstdc++'s <iostream>, where the presence of using
In the longer term, I'd like to eliminate Sema::isDeclInScope in favor
of better handling of the RedeclarationOnly flag in the name-lookup
routines. That way, name lookup only returns the entities that matter,
rather than taking the current two-pass approach of producing too many
results and then filtering our the wrong results. It's not efficient,
and I'm sure that we aren't filtering everywhere we should be.
llvm-svn: 82954
Diffstat (limited to 'clang/test/SemaCXX/using-decl-1.cpp')
-rw-r--r-- | clang/test/SemaCXX/using-decl-1.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/using-decl-1.cpp b/clang/test/SemaCXX/using-decl-1.cpp index 2459f251deb..37e101e221e 100644 --- a/clang/test/SemaCXX/using-decl-1.cpp +++ b/clang/test/SemaCXX/using-decl-1.cpp @@ -6,3 +6,14 @@ namespace std { using ::f; inline void f() { return f(true); } } + +namespace M { + void f(float); +} + +namespace N { + using M::f; + void f(int) { } // expected-note{{previous}} + + void f(int) { } // expected-error{{redefinition}} +} |