C++ PATCH to add a test for c++/81860

Marek Polacek polacek@redhat.com
Tue Jan 2 14:36:00 GMT 2018


This test exercising inheriting a template constructor in this PR got fixed with 
r251426.  As I don't see any lambdas here, I thought it worth to add it.

Tested on x86_64-linux, ok for trunk?

2018-01-02  Marek Polacek  <polacek@redhat.com>

	PR c++/81860
	* g++.dg/cpp0x/inh-ctor30.C: New test.

--- gcc/testsuite/g++.dg/cpp0x/inh-ctor30.C
+++ gcc/testsuite/g++.dg/cpp0x/inh-ctor30.C
@@ -0,0 +1,27 @@
+// PR c++/81860
+// { dg-do compile { target c++11 } }
+// { dg-final { scan-assembler "_ZN1AIjEC2Ev" } }
+
+template <typename T>
+struct A
+{
+  A() {}
+};
+
+struct B
+{
+  template <typename D>
+  B(D, const A<unsigned>& a = A<unsigned>()) : a(a) {}
+
+  A<unsigned> a;
+};
+
+struct C : B
+{
+  using B::B;
+};
+
+int main()
+{
+  C c(0);
+}

	Marek



More information about the Gcc-patches mailing list