[Bug c++/96994] Missing code from consteval constructor initializing const variable

2021-04-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994 Jakub Jelinek changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug c++/96994] Missing code from consteval constructor initializing const variable

2020-10-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994 --- Comment #10 from CVS Commits --- The releases/gcc-10 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:2513dad670c00dd9db3a85be348f6f4020b18b81 commit r10-8853-g2513dad670c00dd9db3a85be348f6f4020b18b81 Author: Jakub Jelinek

[Bug c++/96994] Missing code from consteval constructor initializing const variable

2020-10-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994 --- Comment #9 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:56da736cc6ced0f1c339744321a14ae569db8606 commit r11-3582-g56da736cc6ced0f1c339744321a14ae569db8606 Author: Jakub Jelinek Date:

[Bug c++/96994] Missing code from consteval constructor initializing const variable

2020-09-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994 Marek Polacek changed: What|Removed |Added Keywords||patch --- Comment #8 from Marek Polacek

[Bug c++/96994] Missing code from consteval constructor initializing const variable

2020-09-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994 --- Comment #7 from Jakub Jelinek --- So, what I see is that expand_default_init calls build_special_member_call for the default ctor, but because the default ctor is an immediate method, it returns a TARGET_EXPR with CONSTRUCTOR as the

[Bug c++/96994] Missing code from consteval constructor initializing const variable

2020-09-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994 --- Comment #6 from Jakub Jelinek --- Though, when the ctor is constexpr, it is constant initialized even without it, so probably the bug is somewhere else.

[Bug c++/96994] Missing code from consteval constructor initializing const variable

2020-09-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994 --- Comment #5 from Jakub Jelinek --- More complete testcase: struct A { consteval A () { i = 1; } consteval A (int x) : i (x) {} int i = 0; }; struct B { constexpr B () { i = 1; } constexpr B (int x) : i (x) {} int i = 0; }; A const a;

[Bug c++/96994] Missing code from consteval constructor initializing const variable

2020-09-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994 --- Comment #4 from Marek Polacek --- Yes, a way to fix this would be to do the build_functional_cast in check_initializer: 6892 else if (DECL_DECLARED_CONSTEXPR_P (decl) 6893|| (flags & LOOKUP_CONSTINIT)) 6894

[Bug c++/96994] Missing code from consteval constructor initializing const variable

2020-09-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994 --- Comment #3 from Jakub Jelinek --- Though: struct A { consteval A (int x) { i = x; } int i = 0; }; struct B { constexpr B (int x) { i = x; } int i = 0; }; A const a = 1; constexpr A b = 2; B const c = 3; A constinit d = 4; static_assert (b.i

[Bug c++/96994] Missing code from consteval constructor initializing const variable

2020-09-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #2

[Bug c++/96994] Missing code from consteval constructor initializing const variable

2020-09-09 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994 Marek Polacek changed: What|Removed |Added Status|UNCONFIRMED |NEW CC|