]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: add test for DR 2855
authorMarek Polacek <polacek@redhat.com>
Tue, 14 May 2024 17:48:30 +0000 (13:48 -0400)
committerMarek Polacek <polacek@redhat.com>
Wed, 15 May 2024 15:28:37 +0000 (11:28 -0400)
commit3cefe91b74f65f0db71472e01ca83c69e2cd81cc
tree79f701a14d8e1555391e4aa834922d519b579c84
parent5609d77e683944439fae38323ecabc44a1eb4671
c++: add test for DR 2855

Let

  int8_t x = 127;

This DR says that while

  x++;

invokes UB,

  ++x;

does not.  The resolution was to make the first one valid.  The
following test verifies that we don't report any errors in a constexpr
context.

DR 2855

gcc/testsuite/ChangeLog:

* g++.dg/DRs/dr2855.C: New test.
gcc/testsuite/g++.dg/DRs/dr2855.C [new file with mode: 0644]