view gcc/testsuite/g++.dg/cpp1z/inh-ctor35.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// Core 1715
// { dg-do compile { target c++11 } }
// { dg-options -fno-new-inheriting-ctors }

template<class T> struct S {
private:
  typedef int X;
  friend struct B;
};

struct B {
  template<class T> B(T, typename T::X);
};

struct D: B {
  using B::B;			// { dg-prune-output "private" }
};

S<int> s;
B b(s, 2); // Okay, thanks to friendship.
D d(s, 2); // { dg-error "" } was an error before P0136