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.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang-tools-extra/test/change-namespace/lambda-function.cpp b/clang-tools-extra/test/change-namespace/lambda-function.cpp
new file mode 100644
index 00000000000..484989ef41a
--- /dev/null
+++ b/clang-tools-extra/test/change-namespace/lambda-function.cpp
@@ -0,0 +1,22 @@
+// RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" --file_pattern ".*" %s -- -std=c++11 | sed 's,// CHECK.*,,' | FileCheck %s
+
+template <class T>
+class function;
+template <class R, class... ArgTypes>
+class function<R(ArgTypes...)> {
+public:
+ template <typename Functor>
+ function(Functor f) {}
+ R operator()(ArgTypes...) const {}
+};
+
+// CHECK: namespace x {
+// CHECK-NEXT: namespace y {
+namespace na {
+namespace nb {
+void f(function<void(int)> func, int param) { func(param); }
+void g() { f([](int x) {}, 1); }
+// CHECK: } // namespace y
+// CHECK-NEXT: } // namespace x
+}
+}
OpenPOWER on IntegriCloud