view gcc/testsuite/g++.dg/cpp1z/constexpr-if15.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 1830386684a0
children
line wrap: on
line source

// PR c++/84854
// { dg-do compile { target c++17 } }

constexpr int foo () { return 1; }
constexpr int foo (int) { return 2; }

template <typename>
void a()
{
  if constexpr(foo) { };	// { dg-error "overloaded" }
}