summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/def.h7
-rw-r--r--clang/test/Modules/Inputs/namespaces-top.h5
-rw-r--r--clang/test/Modules/cxx-templates.cpp3
-rw-r--r--clang/test/Modules/decldef.mm10
-rw-r--r--clang/test/Modules/namespaces.cpp7
5 files changed, 27 insertions, 5 deletions
diff --git a/clang/test/Modules/Inputs/def.h b/clang/test/Modules/Inputs/def.h
index eb7eb7e59dc..6fa83d3eec7 100644
--- a/clang/test/Modules/Inputs/def.h
+++ b/clang/test/Modules/Inputs/def.h
@@ -17,4 +17,11 @@ class Def2 {
public:
void func();
};
+
+namespace Def3NS {
+ class Def3 {
+ public:
+ void func();
+ };
+}
#endif
diff --git a/clang/test/Modules/Inputs/namespaces-top.h b/clang/test/Modules/Inputs/namespaces-top.h
index 0c607f52851..7aa8490eb7e 100644
--- a/clang/test/Modules/Inputs/namespaces-top.h
+++ b/clang/test/Modules/Inputs/namespaces-top.h
@@ -12,3 +12,8 @@ namespace N3 {
namespace N12 { }
+namespace N13 {
+ void f();
+ int f(int);
+ void (*p)() = &f;
+}
diff --git a/clang/test/Modules/cxx-templates.cpp b/clang/test/Modules/cxx-templates.cpp
index 0949436b5d8..9e6cd17828e 100644
--- a/clang/test/Modules/cxx-templates.cpp
+++ b/clang/test/Modules/cxx-templates.cpp
@@ -82,11 +82,8 @@ typedef SomeTemplate<int&> SomeTemplateIntRef;
SomeTemplate<char*> some_template_char_ptr;
SomeTemplate<char&> some_template_char_ref;
-// FIXME: There should only be two 'f's here.
// CHECK-GLOBAL: DeclarationName 'f'
// CHECK-GLOBAL-NEXT: |-FunctionTemplate {{.*}} 'f'
-// CHECK-GLOBAL-NEXT: |-FunctionTemplate {{.*}} 'f'
-// CHECK-GLOBAL-NEXT: |-FunctionTemplate {{.*}} 'f'
// CHECK-GLOBAL-NEXT: `-FunctionTemplate {{.*}} 'f'
// CHECK-NAMESPACE-N: DeclarationName 'f'
diff --git a/clang/test/Modules/decldef.mm b/clang/test/Modules/decldef.mm
index c693c7f2ba5..35694935dfb 100644
--- a/clang/test/Modules/decldef.mm
+++ b/clang/test/Modules/decldef.mm
@@ -6,8 +6,10 @@
@class Def;
Def *def;
-class Def2;
+class Def2; // expected-note {{forward decl}}
Def2 *def2;
+namespace Def3NS { class Def3; } // expected-note {{forward decl}}
+Def3NS::Def3 *def3;
@interface Unrelated
- defMethod;
@@ -39,5 +41,9 @@ void testDef() {
}
void testDef2() {
- def2->func();
+ // FIXME: These should both work, since we've (implicitly) imported
+ // decldef.Def here, but they don't, because nothing has triggered the lazy
+ // loading of the definitions of these classes.
+ def2->func(); // expected-error {{incomplete}}
+ def3->func(); // expected-error {{incomplete}}
}
diff --git a/clang/test/Modules/namespaces.cpp b/clang/test/Modules/namespaces.cpp
index 426e0025f9f..8c225e051bd 100644
--- a/clang/test/Modules/namespaces.cpp
+++ b/clang/test/Modules/namespaces.cpp
@@ -75,3 +75,10 @@ void testAnonymousNotMerged() {
// expected-note@Inputs/namespaces-right.h:60 {{passing argument to parameter here}}
// expected-note@Inputs/namespaces-right.h:67 {{passing argument to parameter here}}
+
+// Test that bringing in one name from an overload set does not hide the rest.
+void testPartialImportOfOverloadSet() {
+ void (*p)() = N13::p;
+ p();
+ N13::f(0);
+}
OpenPOWER on IntegriCloud