File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ struct E {
2525 E (int a) : d(a) {}
2626};
2727
28+ struct Storage {
29+ int x;
30+ };
31+
2832int t1 () {
2933 A a{42 };
3034 return 1 / (a.x - 42 ); // expected-warning {{Division by zero}}
@@ -49,4 +53,9 @@ int t5() {
4953 E e{32 };
5054 return 1 / (e.d .x - 32 ); // expected-warning {{Division by zero}}
5155}
56+
57+ int t6 () {
58+ Storage w (32 );
59+ return 1 / (w.x - 32 ); // expected-warning {{Division by zero}}
60+ }
5261} // namespace GH148875
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ int fooPR10616 (int qX ) {
1313}
1414
1515namespace GH148875 {
16- struct A {
16+ struct A {
1717 int x;
1818 A (int v) : x(v) {}
1919};
@@ -37,6 +37,10 @@ struct E {
3737 E (int a) : d{a} {}
3838};
3939
40+ struct Storage {
41+ int x;
42+ };
43+
4044int t1 () {
4145 A a{42 };
4246 return 1 / (a.x - 42 ); // expected-warning {{Division by zero}}
@@ -61,4 +65,9 @@ int t5() {
6165 E e{32 };
6266 return 1 / (e.d .x - 32 ); // expected-warning {{Division by zero}}
6367}
68+
69+ int t6 () {
70+ Storage w{32 };
71+ return 1 / (w.x - 32 ); // expected-warning {{Division by zero}}
72+ }
6473}
You can’t perform that action at this time.
0 commit comments