1 | // RUN: %clang_analyze_cc1 -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s |
2 | |
3 | // expected-no-diagnostics |
4 | |
5 | int global = 0; |
6 | |
7 | template<typename ...Args> |
8 | int foo1(Args&&... args) { |
9 | if (global > 0) |
10 | return 0; |
11 | else if (global < 0) |
12 | return (args + ...); |
13 | return 1; |
14 | } |
15 | |
16 | // Different opeator in fold expression. |
17 | template<typename ...Args> |
18 | int foo2(Args&&... args) { |
19 | if (global > 0) |
20 | return 0; |
21 | else if (global < 0) |
22 | return (args - ...); |
23 | return 1; |
24 | } |
25 | |
26 | // Parameter pack on a different side |
27 | template<typename ...Args> |
28 | int foo3(Args&&... args) { |
29 | if (global > 0) |
30 | return 0; |
31 | else if (global < 0) |
32 | return -1; |
33 | return (... + args); |
34 | return 1; |
35 | } |
36 | |