1 // We run clang in completion mode to force skipping of function bodies and
2 // check if the function bodies were skipped by observing the warnings that
4 // RUN: not %clang_cc1 -std=c++14 -fsyntax-only -code-completion-at=%s:60:1 %s -o - 2>&1 | FileCheck %s
9 // Check that this function is not skipped.
10 // CHECK: 8:9: warning: using the result of an assignment as a condition without parentheses
15 auto lambda_not_skipped
= []() {
18 // Check that this function is not skipped.
19 // CHECK: 17:9: warning: using the result of an assignment as a condition without parentheses
27 // Check that this function is skipped.
28 // CHECK-NOT: 26:9: warning: using the result of an assignment as a condition without parentheses
32 auto lambda_skipped
= []() -> int {
35 // This could potentially be skipped, but it isn't at the moment.
36 // CHECK: 34:9: warning: using the result of an assignment as a condition without parentheses
41 decltype(auto)** not_skipped_ptr() {
44 // Check that this function is not skipped.
45 // CHECK: 43:9: warning: using the result of an assignment as a condition without parentheses
50 decltype(auto) not_skipped_decltypeauto() {
53 // Check that this function is not skipped.
54 // CHECK: 52:9: warning: using the result of an assignment as a condition without parentheses
59 int complete_in_this_function
;
60 // CHECK: COMPLETION: complete_in_this_function