Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/lookup/name-clash11.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
11 #endif | 11 #endif |
12 | 12 |
13 | 13 |
14 void test_bitset () | 14 void test_bitset () |
15 { | 15 { |
16 int x; // { dg-warning "changes meaning" } | 16 int x; // { dg-message "declared here" } |
17 | 17 |
18 { | 18 { |
19 struct S { | 19 struct S { |
20 int x: sizeof x; // { dg-warning "declaration" } | 20 int x: sizeof x; // { dg-warning "changes meaning" } |
21 }; | 21 }; |
22 } | 22 } |
23 } | 23 } |
24 | 24 |
25 void test_enum () | 25 void test_enum () |
26 { | 26 { |
27 // Also exercise (not covered by c++/69023): | 27 // Also exercise (not covered by c++/69023): |
28 int y; // { dg-warning "changes meaning" } | 28 int y; // { dg-message "declared here" } |
29 { | 29 { |
30 struct S { | 30 struct S { |
31 enum E { | 31 enum E { |
32 y = sizeof y // { dg-warning "declaration" } | 32 y = sizeof y // { dg-warning "9:declaration of .y. changes meaning" } |
33 }; | 33 }; |
34 | 34 |
35 // Verify the enumerator has the correct value. | 35 // Verify the enumerator has the correct value. |
36 void test () { ASSERT (y == sizeof (int)); } | 36 void test () { ASSERT (y == sizeof (int)); } |
37 }; | 37 }; |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 void test_alignas () | 41 void test_alignas () |
42 { | 42 { |
43 enum { A = 16 }; // { dg-warning "changes meaning" } | 43 enum { A = 16 }; // { dg-message "declared here" } |
44 { | 44 { |
45 struct S { | 45 struct S { |
46 #if __cplusplus >= 201103L | 46 #if __cplusplus >= 201103L |
47 alignas (A) | 47 alignas (A) |
48 #else | 48 #else |
49 __attribute__ ((aligned (A))) | 49 __attribute__ ((aligned (A))) |
50 #endif | 50 #endif |
51 int A; // { dg-warning "declaration" } | 51 int A; // { dg-warning "changes meaning" } |
52 | 52 |
53 // Verify the member has the correct alignment. | 53 // Verify the member has the correct alignment. |
54 void test () { ASSERT (__alignof__ (this->A) == 16); } | 54 void test () { ASSERT (__alignof__ (this->A) == 16); } |
55 }; | 55 }; |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 void test_array () | 59 void test_array () |
60 { | 60 { |
61 enum { A = 16 }; // { dg-warning "changes meaning" } | 61 enum { A = 16 }; // { dg-message "declared here" } |
62 { | 62 { |
63 struct S { | 63 struct S { |
64 int A [A]; // { dg-warning "declaration" } | 64 int A [A]; // { dg-warning "changes meaning" } |
65 | 65 |
66 // Verify the member has the correct alignment. | 66 // Verify the member has the correct alignment. |
67 void test () { ASSERT (sizeof (this->A) == 16 * sizeof (int)); } | 67 void test () { ASSERT (sizeof (this->A) == 16 * sizeof (int)); } |
68 }; | 68 }; |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 void test_vector () | 72 void test_vector () |
73 { | 73 { |
74 enum { A = 16 }; // { dg-warning "changes meaning" } | 74 enum { A = 16 }; // { dg-message "declared here" } |
75 { | 75 { |
76 struct S { | 76 struct S { |
77 int A __attribute__ ((vector_size (A))); // { dg-warning "declaration" } | 77 int A __attribute__ ((vector_size (A))); // { dg-warning "changes meaning" } |
78 | 78 |
79 // Verify the member has the correct size. | 79 // Verify the member has the correct size. |
80 void test () { ASSERT (sizeof (this->A) == 16); } | 80 void test () { ASSERT (sizeof (this->A) == 16); } |
81 }; | 81 }; |
82 } | 82 } |