[Bug c++/66477] [constexpr] accepts-invalid with constexpr member call on non-constant reference
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477 Jonathan Wakely changed: What|Removed |Added CC||pkeir at outlook dot com --- Comment #6 from Jonathan Wakely --- *** Bug 92530 has been marked as a duplicate of this bug. ***
[Bug c++/66477] [constexpr] accepts-invalid with constexpr member call on non-constant reference
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477 --- Comment #4 from CVS Commits --- The master branch has been updated by Jason Merrill : https://gcc.gnu.org/g:87fbd5347b33883006dc77e779b9edc590fcd2f0 commit r10-6417-g87fbd5347b33883006dc77e779b9edc590fcd2f0 Author: Jason Merrill Date: Mon Feb 3 16:03:45 2020 -0500 c++: Fix constexpr vs. reference parameter. [expr.const] specifically rules out mentioning a reference even if its address is never used, because it implies indirection that is similarly non-constant for a pointer variable. PR c++/66477 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't defer loading the value of a reference.
[Bug c++/66477] [constexpr] accepts-invalid with constexpr member call on non-constant reference
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477 Jason Merrill changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED Target Milestone|--- |10.0 --- Comment #5 from Jason Merrill --- Fixed for GCC 10.
[Bug c++/66477] [constexpr] accepts-invalid with constexpr member call on non-constant reference
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477 Jason Merrill changed: What|Removed |Added Status|NEW |ASSIGNED CC||jason at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
[Bug c++/66477] [constexpr] accepts-invalid with constexpr member call on non-constant reference
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477 YSC changed: What|Removed |Added CC||yankel-webservices@scialom. ||org --- Comment #3 from YSC --- The invalid test case is still accepted on gcc 9.0. Popped up in a SO question (https://stackoverflow.com/q/57196229/5470596).
[Bug c++/66477] [constexpr] accepts-invalid with constexpr member call on non-constant reference
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477 TC changed: What|Removed |Added CC||rs2740 at gmail dot com --- Comment #2 from TC --- Seems to have something to do with reference-type parameters. struct a { constexpr int size() const { return 3; } }; constexpr bool g(a&) { return true;} void f(a ) { static_assert(r.size() == 3, "error"); // accepted static_assert(g(r), ""); // likewise a& rr = r; static_assert(g(rr), ""); // rejected static_assert(rr.size()==3, ""); // likewise }
[Bug c++/66477] [constexpr] accepts-invalid with constexpr member call on non-constant reference
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477 Martin Sebor changed: What|Removed |Added Keywords||accepts-invalid Last reconfirmed|2015-06-23 00:00:00 |2016-3-15 CC||msebor at gcc dot gnu.org Known to fail||4.9.3, 5.3.0, 6.0 --- Comment #1 from Martin Sebor --- The invalid test case is still accepted on trunk of 6.0 and prior (interestingly, bug 60430 shows a an example of a valid program where a reference is rejected in a constexpr context). $ cat z.c && /home/msebor/build/gcc-trunk-svn/gcc/xgcc -B/home/msebor/build/gcc-trunk-svn/gcc -S -Wall -Wextra -Wpedantic -xc++ z.c && echo SUCCESS struct a { constexpr int size() const { return 3; } }; void f(a ) { static_assert(r.size() == 3, "error"); } SUCCESS
[Bug c++/66477] [constexpr] accepts-invalid with constexpr member call on non-constant reference
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477 Paolo Carlini paolo.carlini at oracle dot com changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2015-06-23 Blocks||55004 Ever confirmed|0 |1 Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004 [Bug 55004] [meta-bug] constexpr issues