summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/change-namespace/lambda-function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/change-namespace/lambda-function.cpp')
-rw-r--r--clang-tools-extra/test/change-namespace/lambda-function.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/clang-tools-extra/test/change-namespace/lambda-function.cpp b/clang-tools-extra/test/change-namespace/lambda-function.cpp
index 484989ef41a..452983ea9c4 100644
--- a/clang-tools-extra/test/change-namespace/lambda-function.cpp
+++ b/clang-tools-extra/test/change-namespace/lambda-function.cpp
@@ -10,12 +10,27 @@ public:
R operator()(ArgTypes...) const {}
};
+namespace x {
// CHECK: namespace x {
-// CHECK-NEXT: namespace y {
+class X {};
+}
+
namespace na {
namespace nb {
+// CHECK: namespace x {
+// CHECK-NEXT: namespace y {
void f(function<void(int)> func, int param) { func(param); }
void g() { f([](int x) {}, 1); }
+
+// x::X in function type parameter list will have translation unit context, so
+// we simply replace it with fully-qualified name.
+using TX = function<x::X(x::X)>;
+// CHECK: using TX = function<X(x::X)>;
+
+class A {};
+using TA = function<A(A)>;
+// CHECK: using TA = function<A(A)>;
+
// CHECK: } // namespace y
// CHECK-NEXT: } // namespace x
}
OpenPOWER on IntegriCloud