Ilya Biryukov | 28f048a | 2018-05-30 12:50:48 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:24:5 %s -o - 2>&1 | FileCheck %s |
| 2 | template <class T> |
| 3 | auto make_func() { |
| 4 | struct impl { |
| 5 | impl* func() { |
| 6 | int x; |
| 7 | if (x = 10) {} |
| 8 | // Check that body of this function is actually skipped. |
| 9 | // CHECK-NOT: crash-skipped-bodies-template-inst.cpp:7:{{[0-9]+}}: warning: using the result of an assignment as a condition without parentheses |
| 10 | return this; |
| 11 | } |
| 12 | }; |
| 13 | |
| 14 | int x; |
| 15 | if (x = 10) {} |
| 16 | // Check that this function is not skipped. |
| 17 | // CHECK: crash-skipped-bodies-template-inst.cpp:15:9: warning: using the result of an assignment as a condition without parentheses |
| 18 | return impl(); |
| 19 | } |
| 20 | |
| 21 | void foo() { |
| 22 | []() { |
| 23 | make_func<int>(); |
| 24 | m |
| 25 | // CHECK: COMPLETION: make_func : [#auto#]make_func<<#class T#>>() |
| 26 | }; |
| 27 | } |