1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
2 | // expected-no-diagnostics |
3 | |
4 | namespace PR6382 { |
5 | int foo() |
6 | { |
7 | goto error; |
8 | { |
9 | struct BitPacker { |
10 | BitPacker() {} |
11 | }; |
12 | BitPacker packer; |
13 | } |
14 | |
15 | error: |
16 | return -1; |
17 | } |
18 | } |
19 | |
20 | namespace PR6383 { |
21 | void test (bool gross) |
22 | { |
23 | struct compare_and_set |
24 | { |
25 | void operator() (const bool inner, const bool gross = false) |
26 | { |
27 | // the code |
28 | } |
29 | } compare_and_set2; |
30 | |
31 | compare_and_set2 (false, gross); |
32 | } |
33 | } |
34 | |
35 | namespace Templates { |
36 | template<int Value> |
37 | void f() { |
38 | struct Inner { |
39 | static int getValue() { return Value; } |
40 | }; |
41 | } |
42 | } |
43 | |
44 | namespace PR25627_dont_odr_use_local_consts { |
45 | template<int> struct X { X(); X(int); }; |
46 | |
47 | void foo() { |
48 | const int N = 10; |
49 | |
50 | struct Local { |
51 | void f(X<N> = X<N>()) {} // OK |
52 | }; |
53 | } |
54 | } |
55 | |