diff options
author | Eric Liu <ioeric@google.com> | 2016-12-14 17:01:52 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2016-12-14 17:01:52 +0000 |
commit | 4fe99e143173199c9ee2ba45ad91c1c4f6e692c5 (patch) | |
tree | 84ea82db954657d0797a89e94760d7f92f05951c /clang-tools-extra/test/change-namespace/lambda-function.cpp | |
parent | bdc0ac0a0e57857cb7e6d3dc007108a51131471c (diff) | |
download | bcm5719-llvm-4fe99e143173199c9ee2ba45ad91c1c4f6e692c5.tar.gz bcm5719-llvm-4fe99e143173199c9ee2ba45ad91c1c4f6e692c5.zip |
[change-namespace] don't crash when type reference is in function type parameter list.
Reviewers: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D27758
llvm-svn: 289672
Diffstat (limited to 'clang-tools-extra/test/change-namespace/lambda-function.cpp')
-rw-r--r-- | clang-tools-extra/test/change-namespace/lambda-function.cpp | 17 |
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 } |