Revert "Remove dependence on <ciso646>" (#126399)
[llvm-project.git] / clang / test / CXX / basic / basic.scope / basic.scope.local / p4-0x.cpp
blobcd51c78a5e9c1f5bb43b1b8f86f7d5cf93c6a81a
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
3 void f() {
4 int b;
5 int arr[] = {1, 2, 3};
7 if (bool b = true) // expected-note 2{{previous definition}}
8 bool b; // expected-error {{redefinition}}
9 else
10 int b; // expected-error {{redefinition}}
11 while (bool b = true) // expected-note {{previous definition}}
12 int b; // expected-error {{redefinition}}
13 for (int c; // expected-note 2{{previous definition}}
14 bool c = true;) // expected-error {{redefinition}}
15 double c; // expected-error {{redefinition}}
16 switch (int n = 37 + 5) // expected-note {{previous definition}}
17 int n; // expected-error {{redefinition}}
18 for (int a : arr) // expected-note {{previous definition}}
19 int a = 0; // expected-error {{redefinition}}
21 if (bool b = true) { // expected-note 2{{previous definition}}
22 int b; // expected-error {{redefinition}}
23 } else {
24 int b; // expected-error {{redefinition}}
26 while (bool b = true) { // expected-note {{previous definition}}
27 int b; // expected-error {{redefinition}}
29 for (int c; // expected-note 2{{previous definition}}
30 bool c = true;) { // expected-error {{redefinition}}
31 double c; // expected-error {{redefinition}}
33 switch (int n = 37 + 5) { // expected-note {{previous definition}}
34 int n; // expected-error {{redefinition}}
36 for (int &a : arr) { // expected-note {{previous definition}}
37 int a = 0; // expected-error {{redefinition}}
40 if (bool b = true) {{ // expected-note {{previous definition}}
41 bool b;
42 }} else {
43 int b; // expected-error {{redefinition}}
45 if (bool b = true) { // expected-note {{previous definition}}
46 bool b; // expected-error {{redefinition}}
47 } else {{
48 int b;
50 if (bool b = true) {{
51 bool b;
52 }} else {{
53 int b;
55 while (bool b = true) {{
56 int b;
58 for (int c; // expected-note {{previous definition}}
59 bool c = true; ) {{ // expected-error {{redefinition}}
60 double c;
62 switch (int n = 37 + 5) {{
63 int n;
65 for (int &a : arr) {{
66 int a = 0;