aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/using-decl-1.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-28 00:47:05 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-28 00:47:05 +0000
commit2531c2d2f1e8ce35f2ce8e9539738ddf8dccb7cc (patch)
tree485e03397ececf4e424f9e50d48d2defb2ce8061 /test/SemaCXX/using-decl-1.cpp
parent182ddf0e5dc5667e6683a58b483a2e52564f4303 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82954 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/using-decl-1.cpp')
-rw-r--r--test/SemaCXX/using-decl-1.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaCXX/using-decl-1.cpp b/test/SemaCXX/using-decl-1.cpp
index 2459f251de..37e101e221 100644
--- a/test/SemaCXX/using-decl-1.cpp
+++ b/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}}
+}