view gcc/testsuite/g++.dg/parse/ambig10.C @ 19:2b5abeee2509 default tip

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

// PR c++/88754
// { dg-do compile }

struct A
{
  A(int);
  void foo();
};

template<int N> int value() { return N; }

void bar()
{
  A(value<0>()).foo();
  A(value<0>());
  (A(value<0>())).foo();

  A value<0>; // { dg-error "invalid declaration" }
  A value<0>(); // { dg-error "invalid declaration" }
}