[Bug c++/99859] constexpr evaluation with member function is incorrect

2022-02-02 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 Jonathan Wakely changed: What|Removed |Added CC||asorenji at gmail dot com --- Comment

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 Andrew Pinski changed: What|Removed |Added Status|ASSIGNED|RESOLVED Target Milestone|---

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-08-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 Andrew Pinski changed: What|Removed |Added CC||johelegp at gmail dot com --- Comment #2

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-07-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #21 from Andrew Pinski --- Looks to be fixed in GCC 11. It still fails for me with GCC 10.3 though.

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-20 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #20 from CVS Commits --- The releases/gcc-10 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:e961da38630c892dfc0723e0726b6a0b0833e951 commit r10-9722-ge961da38630c892dfc0723e0726b6a0b0833e951 Author: Jakub Jelinek

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-18 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 Patrick Palka changed: What|Removed |Added CC||pkeir at outlook dot com --- Comment #19

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-08 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 Jakub Jelinek changed: What|Removed |Added CC||vittorio.romeo at outlook dot com --- C

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-08 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #17 from Jakub Jelinek --- Fixed on the trunk, I think we want to backport this though eventually.

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #16 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:559d2f1e0eafd96c19dc5324db1a466286c0e7fc commit r11-8056-g559d2f1e0eafd96c19dc5324db1a466286c0e7fc Author: Jakub Jelinek Date: T

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 Jakub Jelinek changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned a

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #14 from Patrick Palka --- (In reply to Jakub Jelinek from comment #11) > For the global vars (so PR80039 too), can the problem be anything but when > cxx_eval_outermost_constant_expr is called on such an object (or part > thereof)? >

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #13 from Jakub Jelinek --- (In reply to Jakub Jelinek from comment #12) > And in #c9 you're right that it could be embedded in CONSTRUCTORs too. Wonder if cp_walk_tree &arg to find the ADDR_EXPR of heap var addresses and ctx->global-

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #12 from Jakub Jelinek --- And in #c9 you're right that it could be embedded in CONSTRUCTORs too.

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #11 from Jakub Jelinek --- For the global vars (so PR80039 too), can the problem be anything but when cxx_eval_outermost_constant_expr is called on such an object (or part thereof)? Unfortunately, ctx->object might be NULL, perhaps we

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #10 from Jakub Jelinek --- So perhaps --- gcc/cp/constexpr.c.jj 2021-03-19 18:36:49.165304923 +0100 +++ gcc/cp/constexpr.c 2021-04-07 15:33:31.993242067 +0200 @@ -1616,6 +1616,22 @@ cxx_bind_parameters_in_call (const const

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #9 from Patrick Palka --- (In reply to Jakub Jelinek from comment #6) > The argument is a pointer. > Now, I bet a pointer to an automatic variable will be seen as non-constant > and so in that case we might be ok. > If the argument is

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #8 from Jakub Jelinek --- Why does it work for: constexpr int foo(int* x) { return ++*x; } struct S { constexpr S() : a(0) { foo(&a); foo(&a); } int a; }; constexpr S s; static_assert (s.a == 2); though? The argument to foo after con

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #7 from Patrick Palka --- constexpr void foo(int* x) { ++*x; } constexpr int bar() { int* x = new int(0); foo(x); foo(x); int y = *x; delete x; return y; } static_assert(bar() == 2); We reject the above testcase for seemi

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #6 from Jakub Jelinek --- The argument is a pointer. Now, I bet a pointer to an automatic variable will be seen as non-constant and so in that case we might be ok. If the argument is a pointer to some global constexpr variable, dunno.

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #5 from Patrick Palka --- (In reply to Jakub Jelinek from comment #4) > So, on the #c3 testcase, if I put a breakpoint before and after > fold_nondependent_expr in finish_static_assert and temporarily in between > those two breakpoint

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 Jakub Jelinek changed: What|Removed |Added CC||jason at gcc dot gnu.org,

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-01 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #3 from Jakub Jelinek --- The instantiation isn't the problem, template struct intrusive_ptr { T *ptr = nullptr; constexpr explicit intrusive_ptr(T* p) : ptr(p) { ++ptr->count_; } constexpr ~intrusive_ptr() { if (ptr-

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-04-01 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org Last reconfir

[Bug c++/99859] constexpr evaluation with member function is incorrect

2021-03-31 Thread ldalessandro at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859 --- Comment #1 from Luke Dalessandro --- It was pointed out that it _also_ works if I change > static_assert(foo()); to > constexpr bool b = foo(); > static_assert(b); static_assert(foo());