diff options
Diffstat (limited to 'clang/test/Refactor/Extract/ExtractExprIntoFunction.cpp')
-rw-r--r-- | clang/test/Refactor/Extract/ExtractExprIntoFunction.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/clang/test/Refactor/Extract/ExtractExprIntoFunction.cpp b/clang/test/Refactor/Extract/ExtractExprIntoFunction.cpp index b4f0b595438..0fccc929859 100644 --- a/clang/test/Refactor/Extract/ExtractExprIntoFunction.cpp +++ b/clang/test/Refactor/Extract/ExtractExprIntoFunction.cpp @@ -1,4 +1,4 @@ -// RUN: clang-refactor extract -selection=test:%s %s -- -std=c++11 2>&1 | grep -v CHECK | FileCheck %s +// RUN: clang-refactor extract -selection=test:%s %s -- -std=c++14 2>&1 | grep -v CHECK | FileCheck %s void simpleExtractNoCaptures() { @@ -42,7 +42,21 @@ struct OutOfBodyStuff { void foo(int x =/*range out_of_body_expr=->+0:58*/1 + 2); }; -// CHECK: 3 'out_of_body_expr' results: +auto inFunctionOutOfBody() -> decltype(/*range out_of_body_expr=->+0:79*/1 + 2) { + struct OutOfBodyStuff { + int FieldInit = /*range out_of_body_expr=->+0:60*/1 + 2; + + void foo(int x =/*range out_of_body_expr=->+0:60*/1 + 2); + }; + enum E { + X = /*range out_of_body_expr=->+0:48*/1 + 2 + }; + int x = 0; + using T = decltype(/*range out_of_body_expr=->+0:61*/x + 3); + return x; +} + +// CHECK: 8 'out_of_body_expr' results: // CHECK: the selected code is not a part of a function's / method's body void simpleExpressionNoExtraction() { |