aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/attr-likely6.C
blob: a04021e503753210554df0dd15abd7911647330c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// PR c++/92343
// { dg-do compile { target c++14 } }

constexpr bool
foo (bool x)
{
  if (x)
    [[unlikely]] return true;
  else
    [[likely]] return false;
}

static_assert (foo (true), "");
static_assert (!foo (false), "");