constexpr struct/class instantiation not working
Bug #1836302 reported by
Toni Neubert
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The following code snipped does not compile under ARM gcc 8.x (also arm-none-eabi):
```
constexpr int bar{1};
struct Foo {
int value{bar};
};
constexpr Foo f;
constexpr Foo f2{}; // Error occurs here.
```
Fails to compile with: 'const Foo{((int)bar)}' is not a constant expression
Check out: https:/
It works in ARM gcc 7.x and all x86-64 clang/gcc version.
To post a comment you must log in.
Solved in GCC 8.2019.3+Update. Thank you! :)