view gcc/testsuite/g++.dg/cpp2a/paren-init26.C @ 152:2b5abeee2509

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

// PR c++/94885 - paren-init of aggregates accepts invalid code.
// { dg-do compile { target c++20 } }

template <typename T, typename = decltype(T(0))> // { dg-error "could not convert" }
void foo();

struct base {};
struct derived : base {};

void
bar()
{
  foo<derived>(); // { dg-error "no matching function" }
}