[Bug c++/79520] Spurious caching for constexpr arguments

2019-08-08 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79520

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Marek Polacek  ---
Done.

[Bug c++/79520] Spurious caching for constexpr arguments

2019-08-08 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79520

--- Comment #3 from Marek Polacek  ---
Author: mpolacek
Date: Thu Aug  8 17:54:58 2019
New Revision: 274214

URL: https://gcc.gnu.org/viewcvs?rev=274214=gcc=rev
Log:
PR c++/79520
* g++.dg/cpp1y/constexpr-79520.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp1y/constexpr-79520.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug c++/79520] Spurious caching for constexpr arguments

2019-08-08 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79520

Marek Polacek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||mpolacek at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

--- Comment #2 from Marek Polacek  ---
Fixed by r255788.  Probably it's worth to add the new test.

[Bug c++/79520] Spurious caching for constexpr arguments

2017-02-16 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79520

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-02-17
 CC||msebor at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
Confirmed with today's top of trunk:

$ cat t.C && gcc -S -Wall -Wextra -Wpedantic t.C
constexpr int f(int const& x) {return x;}

constexpr struct S {
int x = 0;
constexpr S() {(void)f(x); x = 1;}
} s;

static_assert(f(s.x) == 1, "");
t.C:8:1: error: static assertion failed
 static_assert(f(s.x) == 1, "");
 ^