[PATCH] Fix test-suite fallout of default -Wreturn-type.

Jason Merrill jason@redhat.com
Tue Oct 24 14:40:00 GMT 2017


On 10/18/2017 08:48 AM, Martin Liška wrote:
> This is second patch that addresses test-suite fallout. All these tests fail because -Wreturn-type is
> now on by default.

> +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-diag3.C
> -constexpr T g(T t) { return f(t); } // { dg-error "f.int" }
> +constexpr T g(T t) { return f(t); } // { dg-error "f.int" "" { target c++14_only } }

> +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-neg3.C
> -  constexpr int bar() { return a.foo(); } // { dg-error "foo" }
> +  constexpr int bar() { return a.foo(); } // { dg-error "foo" "" { target c++14_only } }

Why are these changes needed?  They aren't "Return a value for functions 
with non-void return type, or change type to void, or add 
-Wno-return-type for test."

The rest of the patch is OK.

Jason



More information about the Gcc-patches mailing list