| 1 |
// PR c++/65525 |
| 2 |
|
| 3 |
struct A |
| 4 |
{ |
| 5 |
int x; |
| 6 |
char y; // Actually, short and bool (types smaller than int?) trigger this ICE too |
| 7 |
// Also: the problem doesn't occur if you put the smaller type first, e.g. "char x; int y;" |
| 8 |
|
| 9 |
A(int x) {} // custom ctor needed for ICE |
| 10 |
}; |
| 11 |
|
| 12 |
int main() |
| 13 |
{ |
| 14 |
A a(0), x(1), y(2); |
| 15 |
|
| 16 |
x = a; // OK |
| 17 |
y = a; // OK |
| 18 |
x = y = a; // ICE: sorry, unimplemented: unexpected AST of kind mem_ref |
| 19 |
// internal compiler error: in potential_constant_expression_1, at cp/constexpr.c:4432 |
| 20 |
|
| 21 |
return 0; |
| 22 |
} |