aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/constexpr-96862.C
blob: daefca94a63ac0429068e44fa1a4f1d504ef13f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// PR c++/96862
// { dg-do compile { target c++17 } }
// { dg-additional-options "-frounding-math -fexcess-precision=fast" }

constexpr double a = 0x1.0p+100 + 0x1.0p-100;
const double b = 0x1.0p+100 + 0x1.0p-100;
const double &&c = 0x1.0p+100 + 0x1.0p-100;
static_assert (0x1.0p+100 + 0x1.0p-100 == 0x1.0p+100, "");

void
foo ()
{
  constexpr double d = 0x1.0p+100 + 0x1.0p-100;
  const double e = 0x1.0p+100 + 0x1.0p-100;
  const double &&f = 0x1.0p+100 + 0x1.0p-100;
  static_assert (0x1.0p+100 + 0x1.0p-100 == 0x1.0p+100, "");
}

const double &g = a;
const double &h = b;