]> granicus.if.org Git - clang/commitdiff
[modules] Apply name visibility rules to names found by ADL.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 12 Jun 2015 01:32:13 +0000 (01:32 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 12 Jun 2015 01:32:13 +0000 (01:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239578 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaLookup.cpp
test/Modules/Inputs/submodules-merge-defs/defs.h
test/Modules/submodules-merge-defs.cpp

index 147b81bc597bfe0713a535e5296a7e1b939a469d..202f027f6f80884e8502274a253d30fdb1693517 100644 (file)
@@ -3032,6 +3032,9 @@ void Sema::ArgumentDependentLookup(DeclarationName Name, SourceLocation Loc,
       if (!isa<FunctionDecl>(D) && !isa<FunctionTemplateDecl>(D))
         continue;
 
+      if (!isVisible(D) && !(D = findAcceptableDecl(*this, D)))
+        continue;
+
       Result.insert(D);
     }
   }
index 44259463a10280785f2cc845493941eb2593fbe1..ad3711f073f95d9654344f08035ad6eb30fff7c3 100644 (file)
@@ -55,3 +55,9 @@ namespace NS {
   template<> struct B<int> : B<int*> {};
   inline void f() {}
 }
+
+namespace StaticInline {
+  struct X {};
+  static inline void f(X);
+  static inline void g(X x) { f(x); }
+}
index e7c0ad7f0c1cbda7d5579ad8cd6e64cfed8a1d97..e942335151e47cf1ce8137501b83c8a8f79ddaaa 100644 (file)
@@ -13,8 +13,8 @@
 
 A pre_a; // expected-error {{must be imported}} expected-error {{must use 'struct'}}
 // expected-note@defs.h:1 +{{here}}
-// FIXME: We should warn that use_a is being used without being imported.
-int pre_use_a = use_a(pre_a); // expected-error {{'A' must be imported}}
+// expected-note@defs.h:2 +{{here}}
+int pre_use_a = use_a(pre_a); // expected-error {{'A' must be imported}} expected-error {{'use_a' must be imported}}
 
 B::Inner2 pre_bi; // expected-error +{{must be imported}}
 // expected-note@defs.h:4 +{{here}}