[PATCH] C++11, implement delegating constructors

Ville Voutilainen ville.voutilainen@gmail.com
Tue Sep 20 18:47:00 GMT 2011


At Tue, 20 Sep 2011 20:29:27 +0300,
Ville Voutilainen wrote:
> --- a/gcc/testsuite/g++.dg/template/meminit1.C
> +++ b/gcc/testsuite/g++.dg/template/meminit1.C
> @@ -2,7 +2,7 @@
>  template <class T >
>  struct S
>  {
> -  S() : S() {} // { dg-error "base" }
> +  S() : S() {}
>  };
>  
> -S<int> s; // { dg-message "required" }
> +S<int> s; // { dg-warning "delegating constructors" }

Duh. That dg-warning should be on line 5, not 8.
Incremental patch follows. Pardon the haste.

diff --git a/gcc/testsuite/g++.dg/template/meminit1.C b/gcc/testsuite/g++.dg/template/meminit1.C
index fc31828..efdbe80 100644
--- a/gcc/testsuite/g++.dg/template/meminit1.C
+++ b/gcc/testsuite/g++.dg/template/meminit1.C
@@ -2,7 +2,7 @@
 template <class T >
 struct S
 {
-  S() : S() {}
+  S() : S() {} // { dg-warning "delegating constructors" }
 };
 
-S<int> s; // { dg-warning "delegating constructors" }
+S<int> s;



More information about the Gcc-patches mailing list