From 19520957ad27c591e888a82d8dd30cb5fccb3896 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 6 Nov 2017 10:05:03 +0100 Subject: [PATCH] Fix test-suite fallout of default -Wreturn-type. 2017-11-06 Martin Liska * c-c++-common/Wimplicit-fallthrough-8.c: Return a value for functions with non-void return type, or change type to void, or add -Wno-return-type for test. * c-c++-common/asan/pr63638.c (f): Likewise. * c-c++-common/goacc/parallel-1.c (firstprivate): Likewise. * c-c++-common/gomp/sink-1.c (depend): Likewise. * c-c++-common/missing-symbol.c: Likewise. * c-c++-common/pr36513-2.c (main2): Likewise. * c-c++-common/pr36513.c (main1): Likewise. * c-c++-common/pr49706-2.c: Likewise. * c-c++-common/pr65120.c: Likewise. * c-c++-common/tm/volatile-1.c (f): Likewise. * c-c++-common/vector-1.c (f): Likewise. * c-c++-common/vector-2.c (f): Likewise. * g++.dg/abi/abi-tag14.C (f): Likewise. (g): Likewise. * g++.dg/abi/abi-tag18.C (f): Likewise. * g++.dg/abi/abi-tag18a.C (f): Likewise. * g++.dg/abi/covariant2.C (struct c3): Likewise. (struct c7): Likewise. * g++.dg/abi/covariant3.C (c1::f6): Likewise. * g++.dg/abi/mangle7.C (f1): Likewise. * g++.dg/asan/pr81340.C (class e): Likewise. (e::f): Likewise. * g++.dg/concepts/fn8.C (struct S): Likewise. * g++.dg/concepts/pr65575.C (f): Likewise. * g++.dg/concepts/template-parm11.C (f): Likewise. * g++.dg/conversion/op6.C: Likewise. * g++.dg/cpp0x/Wunused-variable-1.C (foo): Likewise. * g++.dg/cpp0x/access01.C: Likewise. * g++.dg/cpp0x/alignas3.C (class alignas): Likewise. * g++.dg/cpp0x/auto2.C (f): Likewise. (struct A): Likewise. (main): Likewise. * g++.dg/cpp0x/constexpr-array17.C (struct D): Likewise. * g++.dg/cpp0x/constexpr-defarg2.C (a): Likewise. (B::foo): Likewise. (B::bar): Likewise. * g++.dg/cpp0x/constexpr-memfn1.C (struct Y): Likewise. * g++.dg/cpp0x/dc1.C (struct D): Likewise. * g++.dg/cpp0x/dc3.C (struct D): Likewise. * g++.dg/cpp0x/decltype12.C: Likewise. * g++.dg/cpp0x/decltype17.C (main): Likewise. * g++.dg/cpp0x/decltype3.C: Likewise. * g++.dg/cpp0x/decltype41.C (struct C): Likewise. (struct D): Likewise. * g++.dg/cpp0x/defaulted28.C (f): Likewise. * g++.dg/cpp0x/enum_base3.C (struct D): Likewise. * g++.dg/cpp0x/gen-attrs-4.C (five): Likewise. * g++.dg/cpp0x/initlist96.C: Likewise. * g++.dg/cpp0x/lambda/lambda-58566.C (struct A): Likewise. * g++.dg/cpp0x/lambda/lambda-conv10.C: Likewise. * g++.dg/cpp0x/lambda/lambda-conv12.C: Likewise. * g++.dg/cpp0x/lambda/lambda-defarg3.C: Likewise. * g++.dg/cpp0x/lambda/lambda-ice3.C (Klass::dostuff): Likewise. * g++.dg/cpp0x/lambda/lambda-ice5.C (foo): Likewise. * g++.dg/cpp0x/lambda/lambda-nested2.C (f1): Likewise. * g++.dg/cpp0x/lambda/lambda-template12.C (class X): Likewise. * g++.dg/cpp0x/lambda/lambda-template2.C (struct T): Likewise. * g++.dg/cpp0x/lambda/lambda-this12.C (struct A): Likewise. * g++.dg/cpp0x/nolinkage1.C (main): Likewise. * g++.dg/cpp0x/nolinkage1a.cc (dummy): Likewise. * g++.dg/cpp0x/nsdmi-template5.C: Likewise. * g++.dg/cpp0x/parse1.C (B::B): Likewise. * g++.dg/cpp0x/pr34054.C (foo): Likewise. * g++.dg/cpp0x/pr47416.C: Likewise. * g++.dg/cpp0x/pr58781.C: Likewise. * g++.dg/cpp0x/pr70538.C: Likewise. * g++.dg/cpp0x/pr81325.C: Likewise. * g++.dg/cpp0x/range-for13.C (begin): Likewise. (end): Likewise. * g++.dg/cpp0x/range-for14.C (begin): Likewise. (end): Likewise. * g++.dg/cpp0x/rv2n.C (test2_18): Likewise. (test2_28): Likewise. (test2_38): Likewise. (test2_58): Likewise. (test2_68): Likewise. (test2_78): Likewise. * g++.dg/cpp0x/rv3n.C (test3_128): Likewise. * g++.dg/cpp0x/static_assert10.C (foo): Likewise. * g++.dg/cpp0x/static_assert11.C (struct A): Likewise. * g++.dg/cpp0x/static_assert12.C: Likewise. * g++.dg/cpp0x/static_assert13.C: Likewise. * g++.dg/cpp0x/trailing1.C (struct A): Likewise. * g++.dg/cpp0x/trailing5.C (foo): Likewise. (bar): Likewise. * g++.dg/cpp0x/variadic114.C: Likewise. * g++.dg/cpp0x/variadic57.C (Dims...>::foo): Likewise. (bar): Likewise. * g++.dg/cpp0x/variadic65.C: Likewise. * g++.dg/cpp0x/variadic66.C (bind): Likewise. * g++.dg/cpp0x/variadic97.C: Likewise. * g++.dg/cpp0x/variadic98.C (__attribute__): Likewise. * g++.dg/cpp1y/auto-fn11.C: Likewise. * g++.dg/cpp1y/auto-fn29.C: Likewise. * g++.dg/cpp1y/auto-fn38.C: Likewise. * g++.dg/cpp1y/constexpr-return2.C: Likewise. * g++.dg/cpp1y/lambda-init7.C (foo): Likewise. * g++.dg/cpp1y/pr63996.C: Likewise. * g++.dg/cpp1y/pr65202.C: Likewise. * g++.dg/cpp1y/pr66443-cxx14.C (Ok): Likewise. * g++.dg/cpp1y/pr79253.C (struct D): Likewise. * g++.dg/cpp1y/static_assert1.C: Likewise. * g++.dg/cpp1y/static_assert2.C: Likewise. * g++.dg/cpp1y/var-templ44.C: Likewise. * g++.dg/cpp1z/fold6.C (f): Likewise. * g++.dg/cpp1z/inline-var2.C (foo): Likewise. * g++.dg/cpp1z/lambda-this1.C (struct B): Likewise. * g++.dg/cpp1z/static_assert-nomsg.C: Likewise. * g++.dg/debug/dwarf-eh-personality-1.C (foobar): Likewise. * g++.dg/debug/dwarf2/dwarf4-typedef.C (struct B): Likewise. * g++.dg/debug/dwarf2/icf.C: Likewise. * g++.dg/debug/dwarf2/pr61433.C (main): Likewise. * g++.dg/debug/nullptr01.C (g): Likewise. * g++.dg/debug/pr16792.C (foo): Likewise. * g++.dg/debug/pr46241.C (class btCollisionWorld): Likewise. * g++.dg/debug/pr46338.C (struct S): Likewise. * g++.dg/debug/pr47106.C (baz): Likewise. (bar): Likewise. (foo): Likewise. * g++.dg/debug/pr71057.C (fn1): Likewise. * g++.dg/debug/pr71432.C (class CLIParameterType): Likewise. (CLIParameterType::checkSwitched): Likewise. * g++.dg/debug/pr80461.C (struct B): Likewise. * g++.dg/dfp/44473-1.C (bar): Likewise. * g++.dg/dfp/44473-2.C (bar): Likewise. (foo): Likewise. * g++.dg/eh/builtin1.C: Likewise. * g++.dg/eh/builtin2.C: Likewise. * g++.dg/eh/builtin3.C: Likewise. * g++.dg/eh/pr45569.C (j): Likewise. * g++.dg/eh/unwind2.C: Likewise. * g++.dg/expr/bitfield11.C: Likewise. * g++.dg/expr/static_cast7.C (f): Likewise. * g++.dg/ext/altivec-14.C: Likewise. * g++.dg/ext/asm13.C (fn1): Likewise. * g++.dg/ext/builtin-object-size3.C: Likewise. * g++.dg/ext/has_nothrow_assign_odr.C (main): Likewise. (S::operator=): Likewise. * g++.dg/ext/label7.C (f): Likewise. * g++.dg/ext/label8.C (f): Likewise. * g++.dg/ext/tmplattr7.C (test): Likewise. * g++.dg/ext/vector8.C (f): Likewise. * g++.dg/ext/visibility/anon1.C: Likewise. * g++.dg/ext/visibility/anon2.C (f): Likewise. * g++.dg/ext/visibility/namespace1.C (__attribute): Likewise. * g++.dg/ext/vla16.C (fn1): Likewise. * g++.dg/goacc/reference.C: Likewise. * g++.dg/gomp/pr37189.C: Likewise. * g++.dg/gomp/pr39495-1.C: Likewise. * g++.dg/gomp/pr39495-2.C: Likewise. * g++.dg/gomp/pr82054.C: Likewise. * g++.dg/inherit/covariant10.C (struct c6): Likewise. (struct c17): Likewise. * g++.dg/inherit/covariant11.C (struct c1): Likewise. (struct c3): Likewise. (struct c11): Likewise. (struct c15): Likewise. * g++.dg/inherit/protected1.C (A::operator==): Likewise. * g++.dg/init/inline1.C (struct A): Likewise. * g++.dg/init/new18.C: Likewise. * g++.dg/init/reference2.C (f): Likewise. * g++.dg/init/reference3.C: Likewise. * g++.dg/init/switch1.C (f): Likewise. * g++.dg/ipa/devirt-10.C (struct wxDCBase): Likewise. * g++.dg/ipa/devirt-13.C (main): Likewise. * g++.dg/ipa/devirt-14.C (main): Likewise. * g++.dg/ipa/devirt-15.C (main): Likewise. * g++.dg/ipa/devirt-16.C (main): Likewise. * g++.dg/ipa/devirt-17.C (main): Likewise. * g++.dg/ipa/devirt-18.C (main): Likewise. * g++.dg/ipa/devirt-19.C: Likewise. * g++.dg/ipa/devirt-21.C (main): Likewise. * g++.dg/ipa/devirt-23.C (main): Likewise. * g++.dg/ipa/devirt-38.C: Likewise. * g++.dg/ipa/devirt-40.C (A::m_fn1): Likewise. * g++.dg/ipa/devirt-41.C (main): Likewise. * g++.dg/ipa/devirt-42.C (main): Likewise. * g++.dg/ipa/devirt-44.C (struct A): Likewise. (main): Likewise. * g++.dg/ipa/devirt-45.C (struct A): Likewise. (main): Likewise. * g++.dg/ipa/devirt-48.C (struct B): Likewise. (struct D): Likewise. * g++.dg/ipa/devirt-52.C: Likewise. * g++.dg/ipa/nothrow-1.C (main): Likewise. * g++.dg/ipa/pr43812.C (LocalSurface::bbox): Likewise. * g++.dg/ipa/pr44372.C: Likewise. * g++.dg/ipa/pr45572-1.C (fgetc_unlocked): Likewise. (putc_unlocked): Likewise. (getline): Likewise. (ferror_unlocked): Likewise. * g++.dg/ipa/pr58371.C: Likewise. * g++.dg/ipa/pr59176.C: Likewise. * g++.dg/ipa/pr60640-1.C (class G): Likewise. * g++.dg/ipa/pr61540.C (struct top): Likewise. * g++.dg/ipa/pr63470.C (class FTjackSupport): Likewise. * g++.dg/ipa/pr63587-1.C: Likewise. * g++.dg/ipa/pr63587-2.C: Likewise. * g++.dg/ipa/pr63838.C (__attribute__): Likewise. * g++.dg/ipa/pr63894.C (J::m_fn3): Likewise. * g++.dg/ipa/pr64068.C (class A): Likewise. (A::m_fn2): Likewise. (class C): Likewise. * g++.dg/ipa/pr64896.C (struct D): Likewise. * g++.dg/ipa/pr65002.C: Likewise. * g++.dg/ipa/pr65008.C (__attribute__): Likewise. * g++.dg/ipa/pr65465.C (struct D): Likewise. * g++.dg/ipa/pr66896.C (struct A): Likewise. * g++.dg/ipa/pr68851.C (class G): Likewise. (C::checkPseudoClass): Likewise. * g++.dg/ipa/pr78211.C: Likewise. * g++.dg/ipa/pr79931.C (AttrImpl::insertBefore): Likewise. * g++.dg/ipa/pure-const-1.C (main): Likewise. * g++.dg/ipa/pure-const-2.C (main): Likewise. * g++.dg/ipa/pure-const-3.C (main): Likewise. * g++.dg/ipa/remref-1.C (main): Likewise. * g++.dg/ipa/remref-2.C (main): Likewise. * g++.dg/lookup/builtin2.C (f): Likewise. * g++.dg/lookup/crash3.C (struct A): Likewise. (struct B): Likewise. (crash): Likewise. * g++.dg/lookup/friend20.C: Likewise. * g++.dg/lookup/pr80891-5.C (vf2_subgraph_iso): Likewise. * g++.dg/lookup/struct2.C (A::c): Likewise. * g++.dg/lto/20080709_0.C (f): Likewise. * g++.dg/lto/20080907_0.C: Likewise. * g++.dg/lto/20080915_0.C (struct Baz): Likewise. * g++.dg/lto/20080916_0.C (g): Likewise. * g++.dg/lto/20081022_0.C (main): Likewise. * g++.dg/lto/20081023_0.C (main): Likewise. * g++.dg/lto/20081118_0.C (foo::method): Likewise. * g++.dg/lto/20081118_1.C (bar::method): Likewise. * g++.dg/lto/20081120-1_0.C: Likewise. * g++.dg/lto/20081120-1_1.C: Likewise. * g++.dg/lto/20081127_1.C (main): Likewise. * g++.dg/lto/20081217-2_0.C (struct A): Likewise. * g++.dg/lto/20090303_0.C: Likewise. * g++.dg/lto/20090311-1_0.C: Likewise. * g++.dg/lto/20090312_0.C: Likewise. * g++.dg/lto/20090315_0.C (main): Likewise. * g++.dg/lto/20091002-1_0.C: Likewise. * g++.dg/lto/20091002-2_0.C (class DataArray): Likewise. * g++.dg/lto/20091002-3_0.C (class DataArray): Likewise. * g++.dg/lto/20091004-1_0.C: Likewise. * g++.dg/lto/20091004-2_0.C: Likewise. * g++.dg/lto/20091004-3_1.C (All_Torus_Intersections): Likewise. * g++.dg/lto/20100721-1_0.C (__gthread_active_p): Likewise. * g++.dg/lto/20101010-1_0.C: Likewise. * g++.dg/lto/20101010-2_0.C: Likewise. * g++.dg/lto/pr45679-1_0.C: Likewise. * g++.dg/lto/pr45679-1_1.C: Likewise. * g++.dg/lto/pr45679-2_0.C: Likewise. * g++.dg/lto/pr48042_0.C (B::x): Likewise. * g++.dg/lto/pr51650-1_0.C (fn): Likewise. (main): Likewise. * g++.dg/lto/pr51650-3_0.C (fn): Likewise. (main): Likewise. * g++.dg/lto/pr63270_1.C: Likewise. * g++.dg/lto/pr65193_0.C: Likewise. * g++.dg/lto/pr65302_0.C: Likewise. * g++.dg/lto/pr65316_0.C: Likewise. * g++.dg/lto/pr65475c_0.C: Likewise. * g++.dg/lto/pr65549_0.C (main): Likewise. * g++.dg/lto/pr69077_0.C (cWeightedStdDev::netPack): Likewise. * g++.dg/lto/pr69589_0.C: Likewise. * g++.dg/opt/combine.C (qvariant_cast): Likewise. (QScriptDebuggerBackendPrivate::trace): Likewise. * g++.dg/opt/complex3.C (j): Likewise. * g++.dg/opt/covariant1.C (struct T): Likewise. * g++.dg/opt/declone3.C (Item::m_fn1): Likewise. * g++.dg/opt/dump1.C (__attribute__): Likewise. * g++.dg/opt/inline15.C (struct C): Likewise. (fn2): Likewise. * g++.dg/opt/local1.C (h): Likewise. * g++.dg/opt/memcpy1.C (csBoxClipper::Clip): Likewise. * g++.dg/opt/new1.C: Likewise. * g++.dg/opt/nrv8.C (main): Likewise. * g++.dg/opt/pr23299.C (struct A): Likewise. (struct B): Likewise. (struct C): Likewise. * g++.dg/opt/pr27826.C (struct Geometry): Likewise. * g++.dg/opt/pr44919.C (back_inserter): Likewise. * g++.dg/opt/pr47615.C (main): Likewise. * g++.dg/opt/pr55329.C (struct A): Likewise. * g++.dg/opt/pr61456.C (Set): Likewise. * g++.dg/opt/pr65003.C (D::foo): Likewise. (F::foo): Likewise. * g++.dg/opt/pr65554.C: Likewise. * g++.dg/opt/pr69432.C (struct C): Likewise. * g++.dg/opt/pr78373.C (struct D): Likewise. (Traits>::m_fn4): Likewise. * g++.dg/opt/pr79267.C (struct F): Likewise. * g++.dg/opt/pr82159-2.C: Likewise. * g++.dg/other/array3.C (reserve): Likewise. * g++.dg/other/crash-5.C (f): Likewise. * g++.dg/other/crash-8.C: Likewise. * g++.dg/other/error34.C (S): Likewise. * g++.dg/other/pr22003.C (c3::func): Likewise. * g++.dg/other/pr24623.C (RefCountPointer): Likewise. * g++.dg/other/pr29610.C (struct __normal_iterator): Likewise. (Painter::for_each): Likewise. (Painter::redraw_window): Likewise. * g++.dg/other/pr42645-1.C (struct S): Likewise. * g++.dg/other/pr42645-2.C (foo): Likewise. (f3): Likewise. * g++.dg/other/pr52048.C: Likewise. * g++.dg/other/typedef3.C (XalanCProcessor::getParseOption): Likewise. * g++.dg/overload/defarg4.C (class foo): Likewise. (bar::Initialize): Likewise. * g++.dg/overload/operator5.C (equalIgnoringCase): Likewise. * g++.dg/overload/ref-conv1.C: Likewise. * g++.dg/overload/template5.C (test): Likewise. * g++.dg/parse/crash40.C (class AAA): Likewise. * g++.dg/parse/crash61.C: Likewise. * g++.dg/parse/crash67.C: Likewise. * g++.dg/parse/ctor5.C: Likewise. * g++.dg/parse/defarg4.C (Foo): Likewise. * g++.dg/parse/defarg6.C: Likewise. * g++.dg/parse/error5.C (class Foo): Likewise. * g++.dg/parse/expr2.C (foo): Likewise. * g++.dg/parse/friend7.C: Likewise. * g++.dg/parse/namespace1.C (bar): Likewise. * g++.dg/parse/namespace9.C (g): Likewise. * g++.dg/parse/ret-type2.C: Likewise. * g++.dg/parse/typedef8.C (foo): Likewise. * g++.dg/pch/static-1.C (LocalStaticTest): Likewise. (main): Likewise. * g++.dg/plugin/diagnostic-test-expressions-1.C (test_structure_references): Likewise. (test_postfix_incdec): Likewise. (test_sizeof): Likewise. (test_alignof): Likewise. (test_prefix_incdec): Likewise. * g++.dg/plugin/dumb-plugin-test-1.C (func): Likewise. * g++.dg/plugin/self-assign-test-1.C (func): Likewise. * g++.dg/plugin/self-assign-test-2.C (func): Likewise. * g++.dg/plugin/self-assign-test-3.C (func): Likewise. * g++.dg/pr55513.C (main): Likewise. * g++.dg/pr55604.C (main): Likewise. * g++.dg/pr57662.C: Likewise. * g++.dg/pr58389.C (F::m_fn1): Likewise. * g++.dg/pr59510.C: Likewise. * g++.dg/pr67989.C: Likewise. * g++.dg/pr70590-2.C: Likewise. * g++.dg/pr70590.C: Likewise. * g++.dg/pr70965.C (foo): Likewise. * g++.dg/pr77550.C: Likewise. * g++.dg/pr80287.C (struct A): Likewise. * g++.dg/pr80707.C (A::m_fn1): Likewise. * g++.dg/pr81194.C: Likewise. * g++.dg/spellcheck-identifiers.C: Likewise. * g++.dg/tc1/dr152.C: Likewise. * g++.dg/template/aggr-init1.C (CreateA): Likewise. * g++.dg/template/anon1.C (struct x): Likewise. (struct vector): Likewise. * g++.dg/template/array29.C: Likewise. * g++.dg/template/array7.C (bar): Likewise. * g++.dg/template/canon-type-8.C: Likewise. * g++.dg/template/conv1.C (First::Foo): Likewise. * g++.dg/template/crash107.C: Likewise. * g++.dg/template/crash23.C (f): Likewise. * g++.dg/template/crash8.C (struct bar): Likewise. * g++.dg/template/defarg4.C (struct A): Likewise. * g++.dg/template/dependent-expr9.C: Likewise. * g++.dg/template/error10.C (Btest): Likewise. * g++.dg/template/friend32.C (f): Likewise. * g++.dg/template/init6.C (Graph::Inner::get): Likewise. (main): Likewise. * g++.dg/template/memfriend7.C (A::h): Likewise. * g++.dg/template/new10.C (Analyzer::ReadDictionary): Likewise. * g++.dg/template/nontype12.C (baz): Likewise. * g++.dg/template/overload12.C (foo2): Likewise. * g++.dg/template/overload5.C (foo::f): Likewise. * g++.dg/template/overload8.C (struct A): Likewise. * g++.dg/template/partial10.C (fn): Likewise. (main): Likewise. * g++.dg/template/partial9.C (f): Likewise. * g++.dg/template/qual1.C (shift_compare): Likewise. * g++.dg/template/show-template-tree-3.C: Likewise. * g++.dg/template/sizeof8.C (S + + * c-c++-common/Wimplicit-fallthrough-8.c: Return a value for + functions with non-void return type, or change type to void, or + add -Wno-return-type for test. + * c-c++-common/asan/pr63638.c (f): Likewise. + * c-c++-common/goacc/parallel-1.c (firstprivate): Likewise. + * c-c++-common/gomp/sink-1.c (depend): Likewise. + * c-c++-common/missing-symbol.c: Likewise. + * c-c++-common/pr36513-2.c (main2): Likewise. + * c-c++-common/pr36513.c (main1): Likewise. + * c-c++-common/pr49706-2.c: Likewise. + * c-c++-common/pr65120.c: Likewise. + * c-c++-common/tm/volatile-1.c (f): Likewise. + * c-c++-common/vector-1.c (f): Likewise. + * c-c++-common/vector-2.c (f): Likewise. + * g++.dg/abi/abi-tag14.C (f): Likewise. + (g): Likewise. + * g++.dg/abi/abi-tag18.C (f): Likewise. + * g++.dg/abi/abi-tag18a.C (f): Likewise. + * g++.dg/abi/covariant2.C (struct c3): Likewise. + (struct c7): Likewise. + * g++.dg/abi/covariant3.C (c1::f6): Likewise. + * g++.dg/abi/mangle7.C (f1): Likewise. + * g++.dg/asan/pr81340.C (class e): Likewise. + (e::f): Likewise. + * g++.dg/concepts/fn8.C (struct S): Likewise. + * g++.dg/concepts/pr65575.C (f): Likewise. + * g++.dg/concepts/template-parm11.C (f): Likewise. + * g++.dg/conversion/op6.C: Likewise. + * g++.dg/cpp0x/Wunused-variable-1.C (foo): Likewise. + * g++.dg/cpp0x/access01.C: Likewise. + * g++.dg/cpp0x/alignas3.C (class alignas): Likewise. + * g++.dg/cpp0x/auto2.C (f): Likewise. + (struct A): Likewise. + (main): Likewise. + * g++.dg/cpp0x/constexpr-array17.C (struct D): Likewise. + * g++.dg/cpp0x/constexpr-defarg2.C (a): Likewise. + (B::foo): Likewise. + (B::bar): Likewise. + * g++.dg/cpp0x/constexpr-memfn1.C (struct Y): Likewise. + * g++.dg/cpp0x/dc1.C (struct D): Likewise. + * g++.dg/cpp0x/dc3.C (struct D): Likewise. + * g++.dg/cpp0x/decltype12.C: Likewise. + * g++.dg/cpp0x/decltype17.C (main): Likewise. + * g++.dg/cpp0x/decltype3.C: Likewise. + * g++.dg/cpp0x/decltype41.C (struct C): Likewise. + (struct D): Likewise. + * g++.dg/cpp0x/defaulted28.C (f): Likewise. + * g++.dg/cpp0x/enum_base3.C (struct D): Likewise. + * g++.dg/cpp0x/gen-attrs-4.C (five): Likewise. + * g++.dg/cpp0x/initlist96.C: Likewise. + * g++.dg/cpp0x/lambda/lambda-58566.C (struct A): Likewise. + * g++.dg/cpp0x/lambda/lambda-conv10.C: Likewise. + * g++.dg/cpp0x/lambda/lambda-conv12.C: Likewise. + * g++.dg/cpp0x/lambda/lambda-defarg3.C: Likewise. + * g++.dg/cpp0x/lambda/lambda-ice3.C (Klass::dostuff): Likewise. + * g++.dg/cpp0x/lambda/lambda-ice5.C (foo): Likewise. + * g++.dg/cpp0x/lambda/lambda-nested2.C (f1): Likewise. + * g++.dg/cpp0x/lambda/lambda-template12.C (class X): Likewise. + * g++.dg/cpp0x/lambda/lambda-template2.C (struct T): Likewise. + * g++.dg/cpp0x/lambda/lambda-this12.C (struct A): Likewise. + * g++.dg/cpp0x/nolinkage1.C (main): Likewise. + * g++.dg/cpp0x/nolinkage1a.cc (dummy): Likewise. + * g++.dg/cpp0x/nsdmi-template5.C: Likewise. + * g++.dg/cpp0x/parse1.C (B::B): Likewise. + * g++.dg/cpp0x/pr34054.C (foo): Likewise. + * g++.dg/cpp0x/pr47416.C: Likewise. + * g++.dg/cpp0x/pr58781.C: Likewise. + * g++.dg/cpp0x/pr70538.C: Likewise. + * g++.dg/cpp0x/pr81325.C: Likewise. + * g++.dg/cpp0x/range-for13.C (begin): Likewise. + (end): Likewise. + * g++.dg/cpp0x/range-for14.C (begin): Likewise. + (end): Likewise. + * g++.dg/cpp0x/rv2n.C (test2_18): Likewise. + (test2_28): Likewise. + (test2_38): Likewise. + (test2_58): Likewise. + (test2_68): Likewise. + (test2_78): Likewise. + * g++.dg/cpp0x/rv3n.C (test3_128): Likewise. + * g++.dg/cpp0x/static_assert10.C (foo): Likewise. + * g++.dg/cpp0x/static_assert11.C (struct A): Likewise. + * g++.dg/cpp0x/static_assert12.C: Likewise. + * g++.dg/cpp0x/static_assert13.C: Likewise. + * g++.dg/cpp0x/trailing1.C (struct A): Likewise. + * g++.dg/cpp0x/trailing5.C (foo): Likewise. + (bar): Likewise. + * g++.dg/cpp0x/variadic114.C: Likewise. + * g++.dg/cpp0x/variadic57.C (Dims...>::foo): Likewise. + (bar): Likewise. + * g++.dg/cpp0x/variadic65.C: Likewise. + * g++.dg/cpp0x/variadic66.C (bind): Likewise. + * g++.dg/cpp0x/variadic97.C: Likewise. + * g++.dg/cpp0x/variadic98.C (__attribute__): Likewise. + * g++.dg/cpp1y/auto-fn11.C: Likewise. + * g++.dg/cpp1y/auto-fn29.C: Likewise. + * g++.dg/cpp1y/auto-fn38.C: Likewise. + * g++.dg/cpp1y/constexpr-return2.C: Likewise. + * g++.dg/cpp1y/lambda-init7.C (foo): Likewise. + * g++.dg/cpp1y/pr63996.C: Likewise. + * g++.dg/cpp1y/pr65202.C: Likewise. + * g++.dg/cpp1y/pr66443-cxx14.C (Ok): Likewise. + * g++.dg/cpp1y/pr79253.C (struct D): Likewise. + * g++.dg/cpp1y/static_assert1.C: Likewise. + * g++.dg/cpp1y/static_assert2.C: Likewise. + * g++.dg/cpp1y/var-templ44.C: Likewise. + * g++.dg/cpp1z/fold6.C (f): Likewise. + * g++.dg/cpp1z/inline-var2.C (foo): Likewise. + * g++.dg/cpp1z/lambda-this1.C (struct B): Likewise. + * g++.dg/cpp1z/static_assert-nomsg.C: Likewise. + * g++.dg/debug/dwarf-eh-personality-1.C (foobar): Likewise. + * g++.dg/debug/dwarf2/dwarf4-typedef.C (struct B): Likewise. + * g++.dg/debug/dwarf2/icf.C: Likewise. + * g++.dg/debug/dwarf2/pr61433.C (main): Likewise. + * g++.dg/debug/nullptr01.C (g): Likewise. + * g++.dg/debug/pr16792.C (foo): Likewise. + * g++.dg/debug/pr46241.C (class btCollisionWorld): Likewise. + * g++.dg/debug/pr46338.C (struct S): Likewise. + * g++.dg/debug/pr47106.C (baz): Likewise. + (bar): Likewise. + (foo): Likewise. + * g++.dg/debug/pr71057.C (fn1): Likewise. + * g++.dg/debug/pr71432.C (class CLIParameterType): Likewise. + (CLIParameterType::checkSwitched): Likewise. + * g++.dg/debug/pr80461.C (struct B): Likewise. + * g++.dg/dfp/44473-1.C (bar): Likewise. + * g++.dg/dfp/44473-2.C (bar): Likewise. + (foo): Likewise. + * g++.dg/eh/builtin1.C: Likewise. + * g++.dg/eh/builtin2.C: Likewise. + * g++.dg/eh/builtin3.C: Likewise. + * g++.dg/eh/pr45569.C (j): Likewise. + * g++.dg/eh/unwind2.C: Likewise. + * g++.dg/expr/bitfield11.C: Likewise. + * g++.dg/expr/static_cast7.C (f): Likewise. + * g++.dg/ext/altivec-14.C: Likewise. + * g++.dg/ext/asm13.C (fn1): Likewise. + * g++.dg/ext/builtin-object-size3.C: Likewise. + * g++.dg/ext/has_nothrow_assign_odr.C (main): Likewise. + (S::operator=): Likewise. + * g++.dg/ext/label7.C (f): Likewise. + * g++.dg/ext/label8.C (f): Likewise. + * g++.dg/ext/tmplattr7.C (test): Likewise. + * g++.dg/ext/vector8.C (f): Likewise. + * g++.dg/ext/visibility/anon1.C: Likewise. + * g++.dg/ext/visibility/anon2.C (f): Likewise. + * g++.dg/ext/visibility/namespace1.C (__attribute): Likewise. + * g++.dg/ext/vla16.C (fn1): Likewise. + * g++.dg/goacc/reference.C: Likewise. + * g++.dg/gomp/pr37189.C: Likewise. + * g++.dg/gomp/pr39495-1.C: Likewise. + * g++.dg/gomp/pr39495-2.C: Likewise. + * g++.dg/gomp/pr82054.C: Likewise. + * g++.dg/inherit/covariant10.C (struct c6): Likewise. + (struct c17): Likewise. + * g++.dg/inherit/covariant11.C (struct c1): Likewise. + (struct c3): Likewise. + (struct c11): Likewise. + (struct c15): Likewise. + * g++.dg/inherit/protected1.C (A::operator==): Likewise. + * g++.dg/init/inline1.C (struct A): Likewise. + * g++.dg/init/new18.C: Likewise. + * g++.dg/init/reference2.C (f): Likewise. + * g++.dg/init/reference3.C: Likewise. + * g++.dg/init/switch1.C (f): Likewise. + * g++.dg/ipa/devirt-10.C (struct wxDCBase): Likewise. + * g++.dg/ipa/devirt-13.C (main): Likewise. + * g++.dg/ipa/devirt-14.C (main): Likewise. + * g++.dg/ipa/devirt-15.C (main): Likewise. + * g++.dg/ipa/devirt-16.C (main): Likewise. + * g++.dg/ipa/devirt-17.C (main): Likewise. + * g++.dg/ipa/devirt-18.C (main): Likewise. + * g++.dg/ipa/devirt-19.C: Likewise. + * g++.dg/ipa/devirt-21.C (main): Likewise. + * g++.dg/ipa/devirt-23.C (main): Likewise. + * g++.dg/ipa/devirt-38.C: Likewise. + * g++.dg/ipa/devirt-40.C (A::m_fn1): Likewise. + * g++.dg/ipa/devirt-41.C (main): Likewise. + * g++.dg/ipa/devirt-42.C (main): Likewise. + * g++.dg/ipa/devirt-44.C (struct A): Likewise. + (main): Likewise. + * g++.dg/ipa/devirt-45.C (struct A): Likewise. + (main): Likewise. + * g++.dg/ipa/devirt-48.C (struct B): Likewise. + (struct D): Likewise. + * g++.dg/ipa/devirt-52.C: Likewise. + * g++.dg/ipa/nothrow-1.C (main): Likewise. + * g++.dg/ipa/pr43812.C (LocalSurface::bbox): Likewise. + * g++.dg/ipa/pr44372.C: Likewise. + * g++.dg/ipa/pr45572-1.C (fgetc_unlocked): Likewise. + (putc_unlocked): Likewise. + (getline): Likewise. + (ferror_unlocked): Likewise. + * g++.dg/ipa/pr58371.C: Likewise. + * g++.dg/ipa/pr59176.C: Likewise. + * g++.dg/ipa/pr60640-1.C (class G): Likewise. + * g++.dg/ipa/pr61540.C (struct top): Likewise. + * g++.dg/ipa/pr63470.C (class FTjackSupport): Likewise. + * g++.dg/ipa/pr63587-1.C: Likewise. + * g++.dg/ipa/pr63587-2.C: Likewise. + * g++.dg/ipa/pr63838.C (__attribute__): Likewise. + * g++.dg/ipa/pr63894.C (J::m_fn3): Likewise. + * g++.dg/ipa/pr64068.C (class A): Likewise. + (A::m_fn2): Likewise. + (class C): Likewise. + * g++.dg/ipa/pr64896.C (struct D): Likewise. + * g++.dg/ipa/pr65002.C: Likewise. + * g++.dg/ipa/pr65008.C (__attribute__): Likewise. + * g++.dg/ipa/pr65465.C (struct D): Likewise. + * g++.dg/ipa/pr66896.C (struct A): Likewise. + * g++.dg/ipa/pr68851.C (class G): Likewise. + (C::checkPseudoClass): Likewise. + * g++.dg/ipa/pr78211.C: Likewise. + * g++.dg/ipa/pr79931.C (AttrImpl::insertBefore): Likewise. + * g++.dg/ipa/pure-const-1.C (main): Likewise. + * g++.dg/ipa/pure-const-2.C (main): Likewise. + * g++.dg/ipa/pure-const-3.C (main): Likewise. + * g++.dg/ipa/remref-1.C (main): Likewise. + * g++.dg/ipa/remref-2.C (main): Likewise. + * g++.dg/lookup/builtin2.C (f): Likewise. + * g++.dg/lookup/crash3.C (struct A): Likewise. + (struct B): Likewise. + (crash): Likewise. + * g++.dg/lookup/friend20.C: Likewise. + * g++.dg/lookup/pr80891-5.C (vf2_subgraph_iso): Likewise. + * g++.dg/lookup/struct2.C (A::c): Likewise. + * g++.dg/lto/20080709_0.C (f): Likewise. + * g++.dg/lto/20080907_0.C: Likewise. + * g++.dg/lto/20080915_0.C (struct Baz): Likewise. + * g++.dg/lto/20080916_0.C (g): Likewise. + * g++.dg/lto/20081022_0.C (main): Likewise. + * g++.dg/lto/20081023_0.C (main): Likewise. + * g++.dg/lto/20081118_0.C (foo::method): Likewise. + * g++.dg/lto/20081118_1.C (bar::method): Likewise. + * g++.dg/lto/20081120-1_0.C: Likewise. + * g++.dg/lto/20081120-1_1.C: Likewise. + * g++.dg/lto/20081127_1.C (main): Likewise. + * g++.dg/lto/20081217-2_0.C (struct A): Likewise. + * g++.dg/lto/20090303_0.C: Likewise. + * g++.dg/lto/20090311-1_0.C: Likewise. + * g++.dg/lto/20090312_0.C: Likewise. + * g++.dg/lto/20090315_0.C (main): Likewise. + * g++.dg/lto/20091002-1_0.C: Likewise. + * g++.dg/lto/20091002-2_0.C (class DataArray): Likewise. + * g++.dg/lto/20091002-3_0.C (class DataArray): Likewise. + * g++.dg/lto/20091004-1_0.C: Likewise. + * g++.dg/lto/20091004-2_0.C: Likewise. + * g++.dg/lto/20091004-3_1.C (All_Torus_Intersections): Likewise. + * g++.dg/lto/20100721-1_0.C (__gthread_active_p): Likewise. + * g++.dg/lto/20101010-1_0.C: Likewise. + * g++.dg/lto/20101010-2_0.C: Likewise. + * g++.dg/lto/pr45679-1_0.C: Likewise. + * g++.dg/lto/pr45679-1_1.C: Likewise. + * g++.dg/lto/pr45679-2_0.C: Likewise. + * g++.dg/lto/pr48042_0.C (B::x): Likewise. + * g++.dg/lto/pr51650-1_0.C (fn): Likewise. + (main): Likewise. + * g++.dg/lto/pr51650-3_0.C (fn): Likewise. + (main): Likewise. + * g++.dg/lto/pr63270_1.C: Likewise. + * g++.dg/lto/pr65193_0.C: Likewise. + * g++.dg/lto/pr65302_0.C: Likewise. + * g++.dg/lto/pr65316_0.C: Likewise. + * g++.dg/lto/pr65475c_0.C: Likewise. + * g++.dg/lto/pr65549_0.C (main): Likewise. + * g++.dg/lto/pr69077_0.C (cWeightedStdDev::netPack): Likewise. + * g++.dg/lto/pr69589_0.C: Likewise. + * g++.dg/opt/combine.C (qvariant_cast): Likewise. + (QScriptDebuggerBackendPrivate::trace): Likewise. + * g++.dg/opt/complex3.C (j): Likewise. + * g++.dg/opt/covariant1.C (struct T): Likewise. + * g++.dg/opt/declone3.C (Item::m_fn1): Likewise. + * g++.dg/opt/dump1.C (__attribute__): Likewise. + * g++.dg/opt/inline15.C (struct C): Likewise. + (fn2): Likewise. + * g++.dg/opt/local1.C (h): Likewise. + * g++.dg/opt/memcpy1.C (csBoxClipper::Clip): Likewise. + * g++.dg/opt/new1.C: Likewise. + * g++.dg/opt/nrv8.C (main): Likewise. + * g++.dg/opt/pr23299.C (struct A): Likewise. + (struct B): Likewise. + (struct C): Likewise. + * g++.dg/opt/pr27826.C (struct Geometry): Likewise. + * g++.dg/opt/pr44919.C (back_inserter): Likewise. + * g++.dg/opt/pr47615.C (main): Likewise. + * g++.dg/opt/pr55329.C (struct A): Likewise. + * g++.dg/opt/pr61456.C (Set): Likewise. + * g++.dg/opt/pr65003.C (D::foo): Likewise. + (F::foo): Likewise. + * g++.dg/opt/pr65554.C: Likewise. + * g++.dg/opt/pr69432.C (struct C): Likewise. + * g++.dg/opt/pr78373.C (struct D): Likewise. + (Traits>::m_fn4): Likewise. + * g++.dg/opt/pr79267.C (struct F): Likewise. + * g++.dg/opt/pr82159-2.C: Likewise. + * g++.dg/other/array3.C (reserve): Likewise. + * g++.dg/other/crash-5.C (f): Likewise. + * g++.dg/other/crash-8.C: Likewise. + * g++.dg/other/error34.C (S): Likewise. + * g++.dg/other/pr22003.C (c3::func): Likewise. + * g++.dg/other/pr24623.C (RefCountPointer): Likewise. + * g++.dg/other/pr29610.C (struct __normal_iterator): Likewise. + (Painter::for_each): Likewise. + (Painter::redraw_window): Likewise. + * g++.dg/other/pr42645-1.C (struct S): Likewise. + * g++.dg/other/pr42645-2.C (foo): Likewise. + (f3): Likewise. + * g++.dg/other/pr52048.C: Likewise. + * g++.dg/other/typedef3.C (XalanCProcessor::getParseOption): Likewise. + * g++.dg/overload/defarg4.C (class foo): Likewise. + (bar::Initialize): Likewise. + * g++.dg/overload/operator5.C (equalIgnoringCase): Likewise. + * g++.dg/overload/ref-conv1.C: Likewise. + * g++.dg/overload/template5.C (test): Likewise. + * g++.dg/parse/crash40.C (class AAA): Likewise. + * g++.dg/parse/crash61.C: Likewise. + * g++.dg/parse/crash67.C: Likewise. + * g++.dg/parse/ctor5.C: Likewise. + * g++.dg/parse/defarg4.C (Foo): Likewise. + * g++.dg/parse/defarg6.C: Likewise. + * g++.dg/parse/error5.C (class Foo): Likewise. + * g++.dg/parse/expr2.C (foo): Likewise. + * g++.dg/parse/friend7.C: Likewise. + * g++.dg/parse/namespace1.C (bar): Likewise. + * g++.dg/parse/namespace9.C (g): Likewise. + * g++.dg/parse/ret-type2.C: Likewise. + * g++.dg/parse/typedef8.C (foo): Likewise. + * g++.dg/pch/static-1.C (LocalStaticTest): Likewise. + (main): Likewise. + * g++.dg/plugin/diagnostic-test-expressions-1.C (test_structure_references): Likewise. + (test_postfix_incdec): Likewise. + (test_sizeof): Likewise. + (test_alignof): Likewise. + (test_prefix_incdec): Likewise. + * g++.dg/plugin/dumb-plugin-test-1.C (func): Likewise. + * g++.dg/plugin/self-assign-test-1.C (func): Likewise. + * g++.dg/plugin/self-assign-test-2.C (func): Likewise. + * g++.dg/plugin/self-assign-test-3.C (func): Likewise. + * g++.dg/pr55513.C (main): Likewise. + * g++.dg/pr55604.C (main): Likewise. + * g++.dg/pr57662.C: Likewise. + * g++.dg/pr58389.C (F::m_fn1): Likewise. + * g++.dg/pr59510.C: Likewise. + * g++.dg/pr67989.C: Likewise. + * g++.dg/pr70590-2.C: Likewise. + * g++.dg/pr70590.C: Likewise. + * g++.dg/pr70965.C (foo): Likewise. + * g++.dg/pr77550.C: Likewise. + * g++.dg/pr80287.C (struct A): Likewise. + * g++.dg/pr80707.C (A::m_fn1): Likewise. + * g++.dg/pr81194.C: Likewise. + * g++.dg/spellcheck-identifiers.C: Likewise. + * g++.dg/tc1/dr152.C: Likewise. + * g++.dg/template/aggr-init1.C (CreateA): Likewise. + * g++.dg/template/anon1.C (struct x): Likewise. + (struct vector): Likewise. + * g++.dg/template/array29.C: Likewise. + * g++.dg/template/array7.C (bar): Likewise. + * g++.dg/template/canon-type-8.C: Likewise. + * g++.dg/template/conv1.C (First::Foo): Likewise. + * g++.dg/template/crash107.C: Likewise. + * g++.dg/template/crash23.C (f): Likewise. + * g++.dg/template/crash8.C (struct bar): Likewise. + * g++.dg/template/defarg4.C (struct A): Likewise. + * g++.dg/template/dependent-expr9.C: Likewise. + * g++.dg/template/error10.C (Btest): Likewise. + * g++.dg/template/friend32.C (f): Likewise. + * g++.dg/template/init6.C (Graph::Inner::get): Likewise. + (main): Likewise. + * g++.dg/template/memfriend7.C (A::h): Likewise. + * g++.dg/template/new10.C (Analyzer::ReadDictionary): Likewise. + * g++.dg/template/nontype12.C (baz): Likewise. + * g++.dg/template/overload12.C (foo2): Likewise. + * g++.dg/template/overload5.C (foo::f): Likewise. + * g++.dg/template/overload8.C (struct A): Likewise. + * g++.dg/template/partial10.C (fn): Likewise. + (main): Likewise. + * g++.dg/template/partial9.C (f): Likewise. + * g++.dg/template/qual1.C (shift_compare): Likewise. + * g++.dg/template/show-template-tree-3.C: Likewise. + * g++.dg/template/sizeof8.C (S * c-c++-common/dfp/call-by-value.c (foo32): Return a default diff --git a/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-8.c b/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-8.c index 0ed7928fd79..d146c788b74 100644 --- a/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-8.c +++ b/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-8.c @@ -4,7 +4,7 @@ extern void grace (int); -int +void fn1 (int i) { switch (i) @@ -16,7 +16,7 @@ fn1 (int i) done:; } -int +void fn2 (int i) { switch (i) @@ -32,7 +32,7 @@ fn2 (int i) done:; } -int +void fn3 (int i) { switch (i) @@ -46,7 +46,7 @@ fn3 (int i) done:; } -int +void fn4 (int i) { switch (i) @@ -64,7 +64,7 @@ fn4 (int i) done:; } -int +void fn5 (int i) { switch (i) @@ -83,7 +83,7 @@ fn5 (int i) done:; } -int +void fn6 (int i) { switch (i) diff --git a/gcc/testsuite/c-c++-common/asan/pr63638.c b/gcc/testsuite/c-c++-common/asan/pr63638.c index a8bafc5aad7..619a2b6142a 100644 --- a/gcc/testsuite/c-c++-common/asan/pr63638.c +++ b/gcc/testsuite/c-c++-common/asan/pr63638.c @@ -12,7 +12,7 @@ struct S{ struct S s[6]; -int f(struct S *p) +void f(struct S *p) { memcpy(p, &s[2], sizeof(*p)); memcpy(p, &s[1], sizeof(*p)); diff --git a/gcc/testsuite/c-c++-common/goacc/parallel-1.c b/gcc/testsuite/c-c++-common/goacc/parallel-1.c index 6c6cc88ecad..0afc53adaa8 100644 --- a/gcc/testsuite/c-c++-common/goacc/parallel-1.c +++ b/gcc/testsuite/c-c++-common/goacc/parallel-1.c @@ -35,4 +35,6 @@ parallel_clauses (void) #pragma acc parallel firstprivate (a, b) ; + + return 0; } diff --git a/gcc/testsuite/c-c++-common/gomp/sink-1.c b/gcc/testsuite/c-c++-common/gomp/sink-1.c index 4872a072315..5ee562bfbf7 100644 --- a/gcc/testsuite/c-c++-common/gomp/sink-1.c +++ b/gcc/testsuite/c-c++-common/gomp/sink-1.c @@ -93,4 +93,6 @@ baz () bar (i, j, 0); #pragma omp ordered depend(source) } + + return 0; } diff --git a/gcc/testsuite/c-c++-common/missing-symbol.c b/gcc/testsuite/c-c++-common/missing-symbol.c index 326b9faad7a..ed319d82e54 100644 --- a/gcc/testsuite/c-c++-common/missing-symbol.c +++ b/gcc/testsuite/c-c++-common/missing-symbol.c @@ -1,4 +1,4 @@ -/* { dg-options "-fdiagnostics-show-caret" } */ +/* { dg-options "-fdiagnostics-show-caret -Wno-return-type" } */ extern int foo (void); extern int bar (void); diff --git a/gcc/testsuite/c-c++-common/pr36513-2.c b/gcc/testsuite/c-c++-common/pr36513-2.c index 3c12e1ae89e..d81c81dd4da 100644 --- a/gcc/testsuite/c-c++-common/pr36513-2.c +++ b/gcc/testsuite/c-c++-common/pr36513-2.c @@ -10,4 +10,5 @@ int main2 () { char *s, t; strchr (s, t); + return 0; } diff --git a/gcc/testsuite/c-c++-common/pr36513.c b/gcc/testsuite/c-c++-common/pr36513.c index 026325410a1..b8b2d6d8060 100644 --- a/gcc/testsuite/c-c++-common/pr36513.c +++ b/gcc/testsuite/c-c++-common/pr36513.c @@ -11,5 +11,7 @@ int main1 () && (t) == '\0' ? (char *) __rawmemchr (s, t) : __builtin_strchr (s, t))); + + return 0; } diff --git a/gcc/testsuite/c-c++-common/pr49706-2.c b/gcc/testsuite/c-c++-common/pr49706-2.c index 09cc9eb1407..30a46c286e0 100644 --- a/gcc/testsuite/c-c++-common/pr49706-2.c +++ b/gcc/testsuite/c-c++-common/pr49706-2.c @@ -10,7 +10,7 @@ bool r; -int +void same (int a, int b) { r = !a == !b; diff --git a/gcc/testsuite/c-c++-common/pr65120.c b/gcc/testsuite/c-c++-common/pr65120.c index c9c1f5f7e65..c8762e057d5 100644 --- a/gcc/testsuite/c-c++-common/pr65120.c +++ b/gcc/testsuite/c-c++-common/pr65120.c @@ -9,7 +9,7 @@ bool r; -int +void f1 (int a) { r = !a == 0; @@ -18,7 +18,7 @@ f1 (int a) r = !a != 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */ } -int +void f2 (int a) { r = !a > 0; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */ diff --git a/gcc/testsuite/c-c++-common/tm/volatile-1.c b/gcc/testsuite/c-c++-common/tm/volatile-1.c index eb3799dd972..40b41803555 100644 --- a/gcc/testsuite/c-c++-common/tm/volatile-1.c +++ b/gcc/testsuite/c-c++-common/tm/volatile-1.c @@ -3,7 +3,7 @@ volatile int * p = 0; __attribute ((transaction_safe)) -int f() { +void f() { int x = 0; // ok: not volatile p = &x; // ok: the pointer is not volatile int i = *p; // { dg-error "volatile" "read through volatile glvalue" } diff --git a/gcc/testsuite/c-c++-common/vector-1.c b/gcc/testsuite/c-c++-common/vector-1.c index 288dd1e924c..027d1777943 100644 --- a/gcc/testsuite/c-c++-common/vector-1.c +++ b/gcc/testsuite/c-c++-common/vector-1.c @@ -8,7 +8,7 @@ vector float a; vector int a1; -int f(void) +void f(void) { a = ~a; /* { dg-error "" } */ a1 = ~a1; diff --git a/gcc/testsuite/c-c++-common/vector-2.c b/gcc/testsuite/c-c++-common/vector-2.c index e9f40a35892..9db53a88c5f 100644 --- a/gcc/testsuite/c-c++-common/vector-2.c +++ b/gcc/testsuite/c-c++-common/vector-2.c @@ -9,7 +9,7 @@ vector int a1; vector float b; vector int b1; -int f(void) +void f(void) { a = a | b; /* { dg-error "" } */ a = a & b; /* { dg-error "" } */ diff --git a/gcc/testsuite/g++.dg/abi/abi-tag14.C b/gcc/testsuite/g++.dg/abi/abi-tag14.C index a66e6552cba..3017f492cda 100644 --- a/gcc/testsuite/g++.dg/abi/abi-tag14.C +++ b/gcc/testsuite/g++.dg/abi/abi-tag14.C @@ -8,20 +8,20 @@ inline namespace __cxx11 __attribute ((abi_tag ("cxx11"))) { A a; // { dg-warning "\"cxx11\"" } // { dg-final { scan-assembler "_Z1fB5cxx11v" } } -A f() {} // { dg-warning "\"cxx11\"" } +A f() { return a; } // { dg-warning "\"cxx11\"" } namespace { A a2; - A f2() {} + A f2() { return a2; } struct B: A {}; } // { dg-final { scan-assembler "_Z1fPN7__cxx111AE" } } -A f(A*) {} +A f(A*) { return a; } // { dg-final { scan-assembler "_Z1gIN7__cxx111AEET_v" } } template T g() { } -template <> A g() { } +template <> A g() { return a; } // { dg-final { scan-assembler "_Z1vIN7__cxx111AEE" { target c++14 } } } #if __cplusplus >= 201402L diff --git a/gcc/testsuite/g++.dg/abi/abi-tag18.C b/gcc/testsuite/g++.dg/abi/abi-tag18.C index 89ee737bf57..ad8e16e692b 100644 --- a/gcc/testsuite/g++.dg/abi/abi-tag18.C +++ b/gcc/testsuite/g++.dg/abi/abi-tag18.C @@ -11,9 +11,11 @@ inline A1 f() { struct T { A2 g() { // { dg-warning "mangled name" } static X x; // { dg-warning "mangled name" } + return A2(); } }; T().g(); + return A1(); } int main() { f(); diff --git a/gcc/testsuite/g++.dg/abi/abi-tag18a.C b/gcc/testsuite/g++.dg/abi/abi-tag18a.C index f65f629bd94..6c569502338 100644 --- a/gcc/testsuite/g++.dg/abi/abi-tag18a.C +++ b/gcc/testsuite/g++.dg/abi/abi-tag18a.C @@ -11,9 +11,11 @@ inline A1 f() { struct T { A2 g() { static X x; + return A2(); } }; T().g(); + return A1(); } int main() { f(); diff --git a/gcc/testsuite/g++.dg/abi/covariant2.C b/gcc/testsuite/g++.dg/abi/covariant2.C index 3231cc4c84c..6c55ad6bb67 100644 --- a/gcc/testsuite/g++.dg/abi/covariant2.C +++ b/gcc/testsuite/g++.dg/abi/covariant2.C @@ -10,7 +10,7 @@ struct c1 {}; struct c3 : virtual c1 { - virtual c1* f6() {} + virtual c1* f6() { return 0; } int i; }; @@ -18,7 +18,7 @@ struct c6 : virtual c3 { }; struct c7 : c3 { - virtual c3* f6() {} + virtual c3* f6() { return 0; } }; struct c24 : virtual c7 diff --git a/gcc/testsuite/g++.dg/abi/covariant3.C b/gcc/testsuite/g++.dg/abi/covariant3.C index 178157c58b2..09b9912524d 100644 --- a/gcc/testsuite/g++.dg/abi/covariant3.C +++ b/gcc/testsuite/g++.dg/abi/covariant3.C @@ -34,7 +34,7 @@ struct c28 : virtual c0, virtual c11 { virtual c18* f6(); }; -c0 *c1::f6 () {} +c0 *c1::f6 () { return 0; } void c5::foo () {} void c10::foo () {} void c18::bar () {} diff --git a/gcc/testsuite/g++.dg/abi/mangle7.C b/gcc/testsuite/g++.dg/abi/mangle7.C index af178d3e599..14c65a24da8 100644 --- a/gcc/testsuite/g++.dg/abi/mangle7.C +++ b/gcc/testsuite/g++.dg/abi/mangle7.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ typedef void *const t1[2]; -float const f1(t1 (&)[79], ...) {} +float const f1(t1 (&)[79], ...) { return 0.0f; } /* { dg-final { scan-assembler _Z2f1RA79_A2_KPvz } } */ diff --git a/gcc/testsuite/g++.dg/asan/pr81340.C b/gcc/testsuite/g++.dg/asan/pr81340.C index 76ac08a9a56..9db5bb46ce7 100644 --- a/gcc/testsuite/g++.dg/asan/pr81340.C +++ b/gcc/testsuite/g++.dg/asan/pr81340.C @@ -10,13 +10,13 @@ public: a(char *) : c(0, d) {} }; class e { - int f(const int &, const int &, const int &, bool, bool, bool, int, bool); + void f(const int &, const int &, const int &, bool, bool, bool, int, bool); }; class g { public: static g *h(); void i(a, void *); }; -int e::f(const int &, const int &, const int &, bool j, bool, bool, int, bool) { +void e::f(const int &, const int &, const int &, bool j, bool, bool, int, bool) { g::h()->i("", &j); } diff --git a/gcc/testsuite/g++.dg/concepts/fn8.C b/gcc/testsuite/g++.dg/concepts/fn8.C index 5c796c7e3b2..b91f1ae9511 100644 --- a/gcc/testsuite/g++.dg/concepts/fn8.C +++ b/gcc/testsuite/g++.dg/concepts/fn8.C @@ -12,7 +12,7 @@ void (*p2)(int) = &f; // { dg-error "no matches" } void (*p3)(int) = &f; // { dg-error "no matches" } struct S { - template int f(T) { } + template int f(T) { return 0; } }; auto p4 = &S::template f; // { dg-error "no matches" } diff --git a/gcc/testsuite/g++.dg/concepts/pr65575.C b/gcc/testsuite/g++.dg/concepts/pr65575.C index e027dccf7d8..6745b843d31 100644 --- a/gcc/testsuite/g++.dg/concepts/pr65575.C +++ b/gcc/testsuite/g++.dg/concepts/pr65575.C @@ -14,7 +14,7 @@ int (*p)() requires true; // { dg-error "" } int (&p)() requires true; // { dg-error "" } int g(int (*)() requires true); // { dg-error "" } -int f() { } +int f() { return 0; } int main() diff --git a/gcc/testsuite/g++.dg/concepts/template-parm11.C b/gcc/testsuite/g++.dg/concepts/template-parm11.C index 73f38815fb7..352acc2271d 100644 --- a/gcc/testsuite/g++.dg/concepts/template-parm11.C +++ b/gcc/testsuite/g++.dg/concepts/template-parm11.C @@ -12,7 +12,7 @@ template void getTable(const ColSpec&...) {} -int f() +void f() { getTable(7, 'a'); // { dg-error "cannot call" } }; diff --git a/gcc/testsuite/g++.dg/conversion/op6.C b/gcc/testsuite/g++.dg/conversion/op6.C index 9aec9f0a808..8a5efc4023a 100644 --- a/gcc/testsuite/g++.dg/conversion/op6.C +++ b/gcc/testsuite/g++.dg/conversion/op6.C @@ -3,9 +3,9 @@ template class smart_pointer { public: - operator T* () const { } - operator bool () const { } - operator bool () { } + operator T* () const { return 0; } + operator bool () const { return true; } + operator bool () { return true; } }; class Context { }; typedef smart_pointer ContextP; diff --git a/gcc/testsuite/g++.dg/cpp0x/Wunused-variable-1.C b/gcc/testsuite/g++.dg/cpp0x/Wunused-variable-1.C index 39592b26a58..dd316d1ace5 100644 --- a/gcc/testsuite/g++.dg/cpp0x/Wunused-variable-1.C +++ b/gcc/testsuite/g++.dg/cpp0x/Wunused-variable-1.C @@ -15,6 +15,7 @@ int foo () { C {} (1, 1L, 1LL, 1.0); + return 0; } template diff --git a/gcc/testsuite/g++.dg/cpp0x/access01.C b/gcc/testsuite/g++.dg/cpp0x/access01.C index 55c951f97d6..3a7cee4156a 100644 --- a/gcc/testsuite/g++.dg/cpp0x/access01.C +++ b/gcc/testsuite/g++.dg/cpp0x/access01.C @@ -6,7 +6,7 @@ class A { T p; public: - template auto f() -> decltype(+p) { } + template auto f() -> decltype(+p) { return p; } }; int main() diff --git a/gcc/testsuite/g++.dg/cpp0x/alignas3.C b/gcc/testsuite/g++.dg/cpp0x/alignas3.C index aa62e5afb2d..af3f171bb3f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/alignas3.C +++ b/gcc/testsuite/g++.dg/cpp0x/alignas3.C @@ -16,5 +16,5 @@ template typename F::ret_type cast(Y &); class CompoundStmt; class alignas(8) Stmt { Stmt *Children[1]; - CompoundStmt *getBlock() const { cast(Children[0]); } + CompoundStmt *getBlock() const { cast(Children[0]); return 0; } }; diff --git a/gcc/testsuite/g++.dg/cpp0x/auto2.C b/gcc/testsuite/g++.dg/cpp0x/auto2.C index cff36d212af..e967b9423a5 100644 --- a/gcc/testsuite/g++.dg/cpp0x/auto2.C +++ b/gcc/testsuite/g++.dg/cpp0x/auto2.C @@ -4,12 +4,12 @@ #include extern "C" void abort(); -int f() {} +int f() { return 0; } struct A { int i; - int f() {} + int f() { return 0; } A operator+(A a) { return a; } }; @@ -70,4 +70,5 @@ int main() } auto j = 42, k = 24; + return 0; } diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array17.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array17.C index c6afa507f02..f722b25ec3d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-array17.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array17.C @@ -18,6 +18,7 @@ struct D { template static _ForwardIterator __uninit_default_n(_ForwardIterator p1, _Size) { _Construct(p1); + return _ForwardIterator(); } }; template diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-defarg2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-defarg2.C index f1ca05fe9ec..515576e1f62 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-defarg2.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-defarg2.C @@ -25,6 +25,9 @@ struct A : D A baz (const char *, A = C ()); +C c; +A a (c); + A B::foo () { @@ -35,10 +38,13 @@ B::foo () catch (...) { } + + return a; } A B::bar () { baz ("bar"); + return a; } diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-memfn1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-memfn1.C index d59f465715d..d58e2ec6b15 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-memfn1.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-memfn1.C @@ -13,6 +13,6 @@ constexpr X X::g(X x) { return x; } struct Y { Y() { } - constexpr Y f(Y y) {} // { dg-error "constexpr" } - static constexpr Y g(Y y) {} // { dg-error "constexpr" } + constexpr Y f(Y y) { return y; } // { dg-error "constexpr" } + static constexpr Y g(Y y) { return y; } // { dg-error "constexpr" } }; diff --git a/gcc/testsuite/g++.dg/cpp0x/dc1.C b/gcc/testsuite/g++.dg/cpp0x/dc1.C index e7ccb64a3b3..5ce50764b5f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/dc1.C +++ b/gcc/testsuite/g++.dg/cpp0x/dc1.C @@ -27,7 +27,7 @@ struct D : public C { D (int _i) : C(), i(_i) { } D () : D(-1) { } virtual ~D() { } - virtual int f () { } + virtual int f () { return 0; } }; void f_D () { C* c = new D(); } diff --git a/gcc/testsuite/g++.dg/cpp0x/dc3.C b/gcc/testsuite/g++.dg/cpp0x/dc3.C index 9c6fd56564c..9c1fd53e4fe 100644 --- a/gcc/testsuite/g++.dg/cpp0x/dc3.C +++ b/gcc/testsuite/g++.dg/cpp0x/dc3.C @@ -43,7 +43,7 @@ struct D : public C { D (int _i) : C(), i(_i) { } D () : D(-1) { } virtual ~D() { } - virtual int f () { } + virtual int f () { return 0; } }; void f_D () { D* d = new D(); } diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype12.C b/gcc/testsuite/g++.dg/cpp0x/decltype12.C index eae318db2df..58fd415eea5 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype12.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype12.C @@ -1,4 +1,6 @@ // { dg-do compile { target c++11 } } +// { dg-additional-options "-Wno-return-type" } + template struct is_same { diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype17.C b/gcc/testsuite/g++.dg/cpp0x/decltype17.C index 6e5854db6c9..47b70ecd89c 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype17.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype17.C @@ -1,5 +1,6 @@ // PR c++/36628 // { dg-do run { target c++11 } } +// { dg-additional-options "-Wno-return-type" } #include #include @@ -25,4 +26,6 @@ int main() return 2; if (strcmp (typeid(h).name(), "FOivE") != 0) return 3; + + return 0; } diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype3.C b/gcc/testsuite/g++.dg/cpp0x/decltype3.C index b2e66243cc7..b921dd6d899 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype3.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype3.C @@ -49,7 +49,7 @@ public: int a; enum B_enum { b }; decltype(a) c; - decltype(a) foo() { } + decltype(a) foo() { return 0; } decltype(b) enums_are_in_scope() { return b; } // ok }; diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype41.C b/gcc/testsuite/g++.dg/cpp0x/decltype41.C index 1439e15c0d4..65f75b1e4fa 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype41.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype41.C @@ -23,15 +23,15 @@ class B template struct C { - template decltype (a.i) f() { } // #1 - template decltype (b.i) f() { } // #2 + template decltype (a.i) f() { return 0; } // #1 + template decltype (b.i) f() { return 1; } // #2 }; template struct D { - template decltype (A::j) f() { } // #1 - template decltype (B::j) f() { } // #2 + template decltype (A::j) f() { return 2; } // #1 + template decltype (B::j) f() { return 3; } // #2 }; int main() diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted28.C b/gcc/testsuite/g++.dg/cpp0x/defaulted28.C index 451a1b4198f..0e04dbfb8d7 100644 --- a/gcc/testsuite/g++.dg/cpp0x/defaulted28.C +++ b/gcc/testsuite/g++.dg/cpp0x/defaulted28.C @@ -9,7 +9,7 @@ private: A(A const&) = default; // { dg-message "private" } }; -int f(...) { } +int f(...) { return 0; } int main() { A a; f(a); // { dg-error "this context" } diff --git a/gcc/testsuite/g++.dg/cpp0x/enum_base3.C b/gcc/testsuite/g++.dg/cpp0x/enum_base3.C index 3cb2d6d8186..5f7e83e1419 100644 --- a/gcc/testsuite/g++.dg/cpp0x/enum_base3.C +++ b/gcc/testsuite/g++.dg/cpp0x/enum_base3.C @@ -17,7 +17,7 @@ struct C }; struct D : C { - B foo () const { B a; a.foo (d); } + B foo () const { B a; a.foo (d); return B(); } H d; }; struct F : C diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C index eb585a89be4..023d8396777 100644 --- a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C +++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C @@ -22,7 +22,7 @@ void two [[gnu::unused]] (void) {} int five(void) [[noreturn]] // { dg-warning "ignored" } -{} +{ return 0; } [[noreturn]] void diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist96.C b/gcc/testsuite/g++.dg/cpp0x/initlist96.C index 45fd128ba83..94e9c0eb148 100644 --- a/gcc/testsuite/g++.dg/cpp0x/initlist96.C +++ b/gcc/testsuite/g++.dg/cpp0x/initlist96.C @@ -1,5 +1,6 @@ // PR c++/66515 // { dg-do compile { target c++11 } } +// { dg-additional-options "-Wno-return-type" } #include diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-58566.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-58566.C index 3101d0a895c..7bcfe3ae70b 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-58566.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-58566.C @@ -6,5 +6,6 @@ struct A int foo() { [this]{ return foo; }; // { dg-error "invalid use of member function|cannot convert" } + return 0; } }; diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv10.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv10.C index 8e806c849ae..c2a60900b35 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv10.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv10.C @@ -1,5 +1,6 @@ // PR c++/69889 // { dg-do compile { target c++11 } } +// { dg-additional-options "-Wno-return-type" } template struct Tag { static void fp() { f()(0); } diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv12.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv12.C index 16adee6b9c3..e1bd38a7bf7 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv12.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv12.C @@ -1,5 +1,6 @@ // PR c++/80767 // { dg-do compile { target c++11 } } +// { dg-additional-options "-Wno-return-type" } template struct A { using type = U; }; template struct B : B::type, B::type { diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg3.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg3.C index 1c593930133..27aac578c07 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg3.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg3.C @@ -10,7 +10,7 @@ struct function template struct C { - static T test(function f = [](int i){return i;}) { } + static T test(function f = [](int i){return i;}) { return T(); } }; int main() diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C index fa8a6e63a93..371d03f941f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C @@ -14,6 +14,8 @@ bool Klass::dostuff() if (local & 1) { return true; } // { dg-error "not captured|non-static" } return false; }; + + return true; } int main() diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice5.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice5.C index 914e0f71e00..50a340dbb22 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice5.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice5.C @@ -4,6 +4,7 @@ template int foo() { [] (void i) { return 0; } (0); // { dg-error "incomplete|invalid|no match" } + return 0; } void bar() diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested2.C index 9e509513ad9..27954f9408c 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested2.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested2.C @@ -13,7 +13,7 @@ void f1(int i) { }; struct s1 { int f; - int work(int n) { + void work(int n) { int m = n*n; int j = 40; auto m3 = [this,m]{ diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template12.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template12.C index 635af97d763..5dfd6ede19c 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template12.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template12.C @@ -14,6 +14,7 @@ class X [&a]{ typename remove_reference < decltype (a) >::type t; }; + return true; } }; template class X< int >; diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template2.C index 29f63afe0df..8fbb821a4d3 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template2.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template2.C @@ -10,7 +10,7 @@ struct T foo (S *p) { S u; - [&u] ()->bool {} (); + [&u] ()->bool { return true; } (); } }; diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this12.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this12.C index ef573b19e02..41e4edd8a0f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this12.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this12.C @@ -3,7 +3,7 @@ struct A { - int f() {} + int f() { return 0; } int i; void foo() diff --git a/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C b/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C index d38028c4b43..474727c135c 100644 --- a/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C +++ b/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C @@ -18,4 +18,4 @@ static void g() A a; } -int main() { g(); f(0); } +int main() { g(); f(0); return 0; } diff --git a/gcc/testsuite/g++.dg/cpp0x/nolinkage1a.cc b/gcc/testsuite/g++.dg/cpp0x/nolinkage1a.cc index f8528f3e650..6672323fdd4 100644 --- a/gcc/testsuite/g++.dg/cpp0x/nolinkage1a.cc +++ b/gcc/testsuite/g++.dg/cpp0x/nolinkage1a.cc @@ -12,4 +12,4 @@ static void g() A a; } -int dummy() { g(); f(0); } +int dummy() { g(); f(0); return 0; } diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template5.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template5.C index fdaf4611ee2..5f23d463003 100644 --- a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template5.C +++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template5.C @@ -7,7 +7,7 @@ template<> struct A1<0> { template struct B1 { - template int foo1() {} + template int foo1() { return 0; } int i1 = foo1(); }; @@ -19,7 +19,7 @@ template<> struct A2<0> { template struct B2 { - template int foo2() {} + template int foo2() { return 1; } int i2 = foo2(); }; @@ -31,7 +31,7 @@ template<> struct A3<0> { template struct B3 { - template int foo3() {} + template int foo3() { return 2; } int i3 = foo3(); }; diff --git a/gcc/testsuite/g++.dg/cpp0x/parse1.C b/gcc/testsuite/g++.dg/cpp0x/parse1.C index 5a11b7337a4..9a2698435b6 100644 --- a/gcc/testsuite/g++.dg/cpp0x/parse1.C +++ b/gcc/testsuite/g++.dg/cpp0x/parse1.C @@ -2,4 +2,4 @@ // { dg-do compile { target c++11 } } typedef int B; // { dg-message "" } -B::B() {} // { dg-error "" } +B::B() { return 0; } // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/cpp0x/pr34054.C b/gcc/testsuite/g++.dg/cpp0x/pr34054.C index 8043f9660ed..7a8b3249701 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr34054.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr34054.C @@ -1,4 +1,4 @@ // PR c++/34054 // { dg-do compile { target c++11 } } -template T foo() {} // { dg-error "not expanded|T" } +template T foo() { return T(); } // { dg-error "not expanded|T" } diff --git a/gcc/testsuite/g++.dg/cpp0x/pr47416.C b/gcc/testsuite/g++.dg/cpp0x/pr47416.C index e4eb317e771..cbe2ed09ff8 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr47416.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr47416.C @@ -1,5 +1,6 @@ // PR c++/47416 // { dg-do compile { target c++11 } } +// { dg-additional-options "-Wno-return-type" } namespace std { diff --git a/gcc/testsuite/g++.dg/cpp0x/pr58781.C b/gcc/testsuite/g++.dg/cpp0x/pr58781.C index 58c972f90f3..069fcd5f6dc 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr58781.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr58781.C @@ -9,7 +9,7 @@ operator""_s(const char32_t *a, size_t b) return 0; } -int +void f() { using a = decltype(U"\x1181"_s); diff --git a/gcc/testsuite/g++.dg/cpp0x/pr70538.C b/gcc/testsuite/g++.dg/cpp0x/pr70538.C index 0347c856c55..05665d6b935 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr70538.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr70538.C @@ -11,5 +11,5 @@ class B { template class C : B { using base_type = B; base_type::base_type; // { dg-warning "access declarations" } - PathComponentPiece m_fn1() {} + PathComponentPiece m_fn1() { return PathComponentPiece(); } }; diff --git a/gcc/testsuite/g++.dg/cpp0x/pr81325.C b/gcc/testsuite/g++.dg/cpp0x/pr81325.C index 11f0900caa2..47f32134477 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr81325.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr81325.C @@ -35,7 +35,7 @@ struct I { }; template struct J { void operator()(); - ResultT operator()(ArgT) {} + ResultT operator()(ArgT) { return ResultT(); } }; struct K { int AllowBind; diff --git a/gcc/testsuite/g++.dg/cpp0x/range-for13.C b/gcc/testsuite/g++.dg/cpp0x/range-for13.C index 100f531f760..9ed0458adcc 100644 --- a/gcc/testsuite/g++.dg/cpp0x/range-for13.C +++ b/gcc/testsuite/g++.dg/cpp0x/range-for13.C @@ -7,10 +7,12 @@ template int *begin(T &t) { T::fail; + return 0; } template int *end(T &t) { T::fail; + return 0; } struct container1 diff --git a/gcc/testsuite/g++.dg/cpp0x/range-for14.C b/gcc/testsuite/g++.dg/cpp0x/range-for14.C index f43e1abcde7..4e0333cf927 100644 --- a/gcc/testsuite/g++.dg/cpp0x/range-for14.C +++ b/gcc/testsuite/g++.dg/cpp0x/range-for14.C @@ -7,10 +7,12 @@ template int *begin(T &t) { T::fail; + return 0; } template int *end(T &t) { T::fail; + return 0; } //Test for defaults diff --git a/gcc/testsuite/g++.dg/cpp0x/rv2n.C b/gcc/testsuite/g++.dg/cpp0x/rv2n.C index 663a66b6d90..65eda80fba0 100644 --- a/gcc/testsuite/g++.dg/cpp0x/rv2n.C +++ b/gcc/testsuite/g++.dg/cpp0x/rv2n.C @@ -144,6 +144,7 @@ int test2_18() sink_2_18(ca); // { dg-error "" } sink_2_18(va); // { dg-error "" } sink_2_18(cva); // { dg-error "" } + return 0; } two sink_2_23(const A&); @@ -250,6 +251,7 @@ int test2_28() const volatile A cva = a; // { dg-error "deleted" } sink_2_28(va); // { dg-error "" } sink_2_28(cva); // { dg-error "" } + return 0; } three sink_2_35(volatile A&); @@ -304,7 +306,7 @@ int test2_37() three sink_2_38(volatile A&); eight sink_2_38(const volatile A&&); -int test2_38() +void test2_38() { A a; const A ca = a; // { dg-error "deleted" } @@ -396,7 +398,7 @@ int test2_57() five sink_2_58( A&&); eight sink_2_58(const volatile A&&); -int test2_58() +void test2_58() { A a; const A ca = a; // { dg-error "deleted" } @@ -439,6 +441,7 @@ int test2_68() sink_2_68(ca); // { dg-error "" } sink_2_68(va); // { dg-error "" } sink_2_68(cva); // { dg-error "" } + return 0; } seven sink_2_78(volatile A&&); @@ -454,6 +457,7 @@ int test2_78() sink_2_78(ca); // { dg-error "" } sink_2_78(va); // { dg-error "" } sink_2_78(cva); // { dg-error "" } + return 0; } int main() diff --git a/gcc/testsuite/g++.dg/cpp0x/rv3n.C b/gcc/testsuite/g++.dg/cpp0x/rv3n.C index b7c1d7a2343..4549438f8ef 100644 --- a/gcc/testsuite/g++.dg/cpp0x/rv3n.C +++ b/gcc/testsuite/g++.dg/cpp0x/rv3n.C @@ -124,6 +124,7 @@ int test3_128() sink_3_128(va); // { dg-error "" } sink_3_128(cva); // { dg-error "" } + return 0; } one sink_3_134( A&); diff --git a/gcc/testsuite/g++.dg/cpp0x/static_assert10.C b/gcc/testsuite/g++.dg/cpp0x/static_assert10.C index e7f728e3f4f..ffbf3c047eb 100644 --- a/gcc/testsuite/g++.dg/cpp0x/static_assert10.C +++ b/gcc/testsuite/g++.dg/cpp0x/static_assert10.C @@ -5,4 +5,5 @@ template bool foo(T) { int i; static_assert(foo(i), "Error"); // { dg-error "non-constant condition|not usable|non-constexpr" } + return true; } diff --git a/gcc/testsuite/g++.dg/cpp0x/static_assert11.C b/gcc/testsuite/g++.dg/cpp0x/static_assert11.C index 8a7362d5f56..36bf458e25f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/static_assert11.C +++ b/gcc/testsuite/g++.dg/cpp0x/static_assert11.C @@ -6,5 +6,6 @@ struct A template bool foo(T) { static_assert(foo(0), "Error"); // { dg-error "non-constant condition|constant expression" } + return true; } }; diff --git a/gcc/testsuite/g++.dg/cpp0x/static_assert12.C b/gcc/testsuite/g++.dg/cpp0x/static_assert12.C index ff6f40d918f..5d59e540910 100644 --- a/gcc/testsuite/g++.dg/cpp0x/static_assert12.C +++ b/gcc/testsuite/g++.dg/cpp0x/static_assert12.C @@ -14,7 +14,7 @@ template<> }; template - T + void float_thing(T __x) { static_assert(is_float::value, ""); // { dg-error "static assertion failed" } diff --git a/gcc/testsuite/g++.dg/cpp0x/static_assert13.C b/gcc/testsuite/g++.dg/cpp0x/static_assert13.C index 86b0b0360d9..7332ff91882 100644 --- a/gcc/testsuite/g++.dg/cpp0x/static_assert13.C +++ b/gcc/testsuite/g++.dg/cpp0x/static_assert13.C @@ -14,7 +14,7 @@ template<> }; template - T + void float_thing(T __x) { static_assert(is_float::value, ""); // { dg-error "static assertion failed" } diff --git a/gcc/testsuite/g++.dg/cpp0x/trailing1.C b/gcc/testsuite/g++.dg/cpp0x/trailing1.C index 7d9a906d4f3..ecf092bda0d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/trailing1.C +++ b/gcc/testsuite/g++.dg/cpp0x/trailing1.C @@ -40,9 +40,9 @@ decltype(*(T*)0+*(U*)0) add4(T t, U u) template struct A { - T f() {} + T f() { return T(); } template - T g() {} + T g() { return T(); } template struct B { diff --git a/gcc/testsuite/g++.dg/cpp0x/trailing5.C b/gcc/testsuite/g++.dg/cpp0x/trailing5.C index 48f31452e5b..32390d60897 100644 --- a/gcc/testsuite/g++.dg/cpp0x/trailing5.C +++ b/gcc/testsuite/g++.dg/cpp0x/trailing5.C @@ -2,9 +2,9 @@ // { dg-do compile { target c++11 } } struct A {}; -auto foo() -> struct A {} +auto foo() -> struct A { return A(); } enum B {}; -auto bar() -> enum B {} +auto bar() -> enum B { return B(); } auto baz() -> struct C {} {} // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic114.C b/gcc/testsuite/g++.dg/cpp0x/variadic114.C index 82ffe83c7c5..183cb2b5631 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic114.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic114.C @@ -1,5 +1,6 @@ // PR c++/49785 // { dg-do compile { target c++11 } } +// { dg-additional-options "-Wno-return-type" } template struct B { }; template class A; diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic57.C b/gcc/testsuite/g++.dg/cpp0x/variadic57.C index a3d2bf1c5df..4bf014b54da 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic57.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic57.C @@ -10,7 +10,7 @@ struct array { }; template -int array::foo() { } +int array::foo() { return 0; } template -int array::bar() { } +int array::bar() { return 0; } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic65.C b/gcc/testsuite/g++.dg/cpp0x/variadic65.C index 0eef2a5ed25..9223235174f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic65.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic65.C @@ -1,4 +1,6 @@ // { dg-do compile { target c++11 } } +// { dg-additional-options "-Wno-return-type" } + struct unused; template diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic66.C b/gcc/testsuite/g++.dg/cpp0x/variadic66.C index ac922215198..bf86deee8fd 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic66.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic66.C @@ -1,7 +1,7 @@ // { dg-do compile { target c++11 } } template -Result bind(Functor, ArgTypes...) { } +Result bind(Functor, ArgTypes...) { return Result(); } void f() { diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic97.C b/gcc/testsuite/g++.dg/cpp0x/variadic97.C index b251cc3da38..12d05c56237 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic97.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic97.C @@ -21,7 +21,7 @@ template template _Bind<_Functor(_Arg)> - bind(_Functor, _Arg) { } + bind(_Functor, _Arg) { return _Bind<_Functor(_Arg)>(); } struct State { diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic98.C b/gcc/testsuite/g++.dg/cpp0x/variadic98.C index c463cac17e7..6f1d9b40676 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic98.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic98.C @@ -1,5 +1,6 @@ // PR c++/42358 // { dg-do assemble { target c++11 } } +// { dg-additional-options "-Wno-return-type" } typedef __PTRDIFF_TYPE__ ptrdiff_t; typedef __SIZE_TYPE__ size_t; @@ -177,6 +178,7 @@ namespace std __attribute__ ((__visibility__ ("default"))) { }; template struct less : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { + return true; } }; template struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> { diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn11.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn11.C index b6a4b324b7c..9d79fb61e96 100644 --- a/gcc/testsuite/g++.dg/cpp1y/auto-fn11.C +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn11.C @@ -1,4 +1,5 @@ // { dg-do compile { target c++14 } } +// { dg-additional-options "-Wno-return-type" } auto f() { return; } // OK, return type is void auto* g() { return; } // { dg-error "no value" } diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn29.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn29.C index f9260e0ec30..12f13a08906 100644 --- a/gcc/testsuite/g++.dg/cpp1y/auto-fn29.C +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn29.C @@ -24,6 +24,7 @@ namespace Baboon { template bool f4(T const& v){ f2(v); + return true; } } diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn38.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn38.C index ec3cffb2505..4e541625eec 100644 --- a/gcc/testsuite/g++.dg/cpp1y/auto-fn38.C +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn38.C @@ -1,5 +1,6 @@ // PR c++/80145 // { dg-do compile { target c++14 } } +// { dg-additional-options "-Wno-return-type" } auto* foo() { } // { dg-error "no return statements" } auto* foo(); diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C index ae2628d800c..d330ccfed3e 100644 --- a/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C @@ -1,4 +1,5 @@ // { dg-do compile { target c++14 } } +// { dg-additional-options "-Wno-return-type" } constexpr int f (int i) { diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-init7.C b/gcc/testsuite/g++.dg/cpp1y/lambda-init7.C index c943c48dfb0..d0b2dd3f256 100644 --- a/gcc/testsuite/g++.dg/cpp1y/lambda-init7.C +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-init7.C @@ -1,6 +1,6 @@ // PR c++/59349 // { dg-do compile { target c++14 } } -int foo () { +void foo () { [bar()]{}; // { dg-error "empty initializer" } } diff --git a/gcc/testsuite/g++.dg/cpp1y/pr63996.C b/gcc/testsuite/g++.dg/cpp1y/pr63996.C index 8f66cdc3893..da1e0764a10 100644 --- a/gcc/testsuite/g++.dg/cpp1y/pr63996.C +++ b/gcc/testsuite/g++.dg/cpp1y/pr63996.C @@ -1,4 +1,5 @@ // { dg-do compile { target c++14 } } +// { dg-additional-options "-Wno-return-type" } constexpr int foo (int i) diff --git a/gcc/testsuite/g++.dg/cpp1y/pr65202.C b/gcc/testsuite/g++.dg/cpp1y/pr65202.C index 7ce4895a134..43eb01f1fcb 100644 --- a/gcc/testsuite/g++.dg/cpp1y/pr65202.C +++ b/gcc/testsuite/g++.dg/cpp1y/pr65202.C @@ -1,5 +1,6 @@ // // PR c++/65202 // { dg-do compile { target c++14 } } +// { dg-additional-options "-Wno-return-type" } template struct is_move_constructible; template struct is_move_assignable; diff --git a/gcc/testsuite/g++.dg/cpp1y/pr66443-cxx14.C b/gcc/testsuite/g++.dg/cpp1y/pr66443-cxx14.C index 58348082952..ae76f7faa31 100644 --- a/gcc/testsuite/g++.dg/cpp1y/pr66443-cxx14.C +++ b/gcc/testsuite/g++.dg/cpp1y/pr66443-cxx14.C @@ -37,6 +37,7 @@ C::C () bool Ok (C &c) { + return true; } int main () diff --git a/gcc/testsuite/g++.dg/cpp1y/pr79253.C b/gcc/testsuite/g++.dg/cpp1y/pr79253.C index b15efe8873f..181702acc5b 100644 --- a/gcc/testsuite/g++.dg/cpp1y/pr79253.C +++ b/gcc/testsuite/g++.dg/cpp1y/pr79253.C @@ -28,6 +28,6 @@ struct D baz () { bar>; } template struct F { - static B<> baz () { foo> (0, 0); } + static B<> baz () { foo> (0, 0); return B<>(); } }; }; diff --git a/gcc/testsuite/g++.dg/cpp1y/static_assert1.C b/gcc/testsuite/g++.dg/cpp1y/static_assert1.C index 513e347d7e5..ef655f49097 100644 --- a/gcc/testsuite/g++.dg/cpp1y/static_assert1.C +++ b/gcc/testsuite/g++.dg/cpp1y/static_assert1.C @@ -19,6 +19,7 @@ template { static_assert(is_float::value, ""); // { dg-error "static assertion failed" } static_assert(is_float::value); // { dg-error "static assertion failed" } + return T(); } int diff --git a/gcc/testsuite/g++.dg/cpp1y/static_assert2.C b/gcc/testsuite/g++.dg/cpp1y/static_assert2.C index d862282cda8..d602b1e04ce 100644 --- a/gcc/testsuite/g++.dg/cpp1y/static_assert2.C +++ b/gcc/testsuite/g++.dg/cpp1y/static_assert2.C @@ -19,6 +19,7 @@ template { static_assert(is_float::value, ""); // { dg-error "static assertion failed" } static_assert(is_float::value); // { dg-error "static assertion failed" } + return T(); } int diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ44.C b/gcc/testsuite/g++.dg/cpp1y/var-templ44.C index 2fc21a50631..2ef01cf7480 100644 --- a/gcc/testsuite/g++.dg/cpp1y/var-templ44.C +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ44.C @@ -1,5 +1,6 @@ // PR c++/67161 // { dg-do compile { target c++14 } } +// { dg-additional-options "-Wno-return-type" } template struct integral_constant { static constexpr _Tp value = 0; diff --git a/gcc/testsuite/g++.dg/cpp1z/fold6.C b/gcc/testsuite/g++.dg/cpp1z/fold6.C index 48394366692..29a20480e77 100644 --- a/gcc/testsuite/g++.dg/cpp1z/fold6.C +++ b/gcc/testsuite/g++.dg/cpp1z/fold6.C @@ -6,7 +6,7 @@ int i; template -int f() +void f() { (i ? i : Is + ...); // { dg-error "" } (i + Is + ...); // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/cpp1z/inline-var2.C b/gcc/testsuite/g++.dg/cpp1z/inline-var2.C index 1696cb0f240..852531ad258 100644 --- a/gcc/testsuite/g++.dg/cpp1z/inline-var2.C +++ b/gcc/testsuite/g++.dg/cpp1z/inline-var2.C @@ -69,6 +69,7 @@ foo (inline int var31) // { dg-error "'var31' declared as an 'inline' paramet { inline int var32; // { dg-error "'inline' specifier invalid for variable 'var32' declared at block scope" } static inline int var33; // { dg-error "'inline' specifier invalid for variable 'var33' declared at block scope" } + return 0; } template struct Y diff --git a/gcc/testsuite/g++.dg/cpp1z/lambda-this1.C b/gcc/testsuite/g++.dg/cpp1z/lambda-this1.C index a15438019b9..2c49dd9bf73 100644 --- a/gcc/testsuite/g++.dg/cpp1z/lambda-this1.C +++ b/gcc/testsuite/g++.dg/cpp1z/lambda-this1.C @@ -50,7 +50,7 @@ struct B { double foo () { return [this]{ return [*this] { return b; }; }()(); // { dg-error "'*this' capture only available with" "" { target c++14_down } } } - double bar () { + void bar () { auto c = []{ return [*this] { return b; }; }; // { dg-error "'this' was not captured for this lambda function" } } // { dg-error "invalid use of non-static data member 'B::b'" "" { target *-*-* } .-1 } }; // { dg-error "'*this' capture only available with" "" { target c++14_down } .-2 } diff --git a/gcc/testsuite/g++.dg/cpp1z/static_assert-nomsg.C b/gcc/testsuite/g++.dg/cpp1z/static_assert-nomsg.C index 4b265b6716e..6f787cde958 100644 --- a/gcc/testsuite/g++.dg/cpp1z/static_assert-nomsg.C +++ b/gcc/testsuite/g++.dg/cpp1z/static_assert-nomsg.C @@ -13,7 +13,7 @@ template<> }; template - T + void float_thing(T __x) { static_assert(is_float::value, ""); // { dg-error "static assertion failed" } diff --git a/gcc/testsuite/g++.dg/debug/dwarf-eh-personality-1.C b/gcc/testsuite/g++.dg/debug/dwarf-eh-personality-1.C index 5c72588e513..8f62edc1cf0 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf-eh-personality-1.C +++ b/gcc/testsuite/g++.dg/debug/dwarf-eh-personality-1.C @@ -11,7 +11,7 @@ int foo (void) return 0; } -int foobar (void) +void foobar (void) { } diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C b/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C index cd1a0afe868..a514472b397 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C @@ -11,7 +11,7 @@ struct A { struct B : public A { template - bool foo(A x[2]) { } + bool foo(A x[2]) { return true; } }; template diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/icf.C b/gcc/testsuite/g++.dg/debug/dwarf2/icf.C index ca73ab72479..74a11bf25c5 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2/icf.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/icf.C @@ -21,13 +21,13 @@ class B int j; }; -int +void test1(A* a) { a->work(); } -int +void test2(A* a) { if (a->p()) diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C index a217d960205..ef2479f0cd9 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C @@ -2,6 +2,7 @@ // { dg-do compile { target c++11 } } // { dg-xfail-if "" { powerpc-ibm-aix* } } // { dg-options "-O -fcompare-debug -fno-inline -fno-ipa-pure-const -fipa-sra" } +// { dg-additional-options "-Wno-return-type" } template struct A @@ -21,4 +22,5 @@ auto k(T t, U u, V v) -> decltype (t.U::template B::MEM) int main() { k( C(), A(), D() ); + return 0; } diff --git a/gcc/testsuite/g++.dg/debug/nullptr01.C b/gcc/testsuite/g++.dg/debug/nullptr01.C index 63c16ac8f0e..a6514f1ff70 100644 --- a/gcc/testsuite/g++.dg/debug/nullptr01.C +++ b/gcc/testsuite/g++.dg/debug/nullptr01.C @@ -10,6 +10,7 @@ template nullptr_t g(T t); template <> nullptr_t g(A) { nullptr_t local; + return nullptr; } // { dg-final { scan-assembler "_Z1fDn" } } // { dg-final { scan-assembler "_Z1gI1AIDnEEDnT_" } } diff --git a/gcc/testsuite/g++.dg/debug/pr16792.C b/gcc/testsuite/g++.dg/debug/pr16792.C index 39003cbe299..0efcbfa74eb 100644 --- a/gcc/testsuite/g++.dg/debug/pr16792.C +++ b/gcc/testsuite/g++.dg/debug/pr16792.C @@ -1,7 +1,7 @@ // { dg-do compile } struct S { S(); }; -int foo (S b, double j) { }; +int foo (S b, double j) { return 0; }; int main () { diff --git a/gcc/testsuite/g++.dg/debug/pr46241.C b/gcc/testsuite/g++.dg/debug/pr46241.C index 95c814d4f0a..6ac9116a3d7 100644 --- a/gcc/testsuite/g++.dg/debug/pr46241.C +++ b/gcc/testsuite/g++.dg/debug/pr46241.C @@ -1,6 +1,6 @@ class btIDebugDraw; class btCollisionWorld { - virtual btIDebugDraw* getDebugDrawer() { }; + virtual btIDebugDraw* getDebugDrawer() { return 0; }; static void rayTestSingle(); }; class btTriangleCallback { diff --git a/gcc/testsuite/g++.dg/debug/pr46338.C b/gcc/testsuite/g++.dg/debug/pr46338.C index caf71170f2c..7e242b9bc3d 100644 --- a/gcc/testsuite/g++.dg/debug/pr46338.C +++ b/gcc/testsuite/g++.dg/debug/pr46338.C @@ -9,6 +9,7 @@ struct S { int f () { + return 0; } }; diff --git a/gcc/testsuite/g++.dg/debug/pr47106.C b/gcc/testsuite/g++.dg/debug/pr47106.C index d8d414dd4a5..84c6e3f87be 100644 --- a/gcc/testsuite/g++.dg/debug/pr47106.C +++ b/gcc/testsuite/g++.dg/debug/pr47106.C @@ -22,12 +22,14 @@ inline bool baz (S s1, S) { while (f (&s1)); + + return true; } inline bool bar (S s1, S s2, S) { - baz (s1, s2); + return baz (s1, s2); } S getS (); @@ -35,5 +37,5 @@ S getS (); bool foo () { - bar (getS (), getS (), getS ()); + return bar (getS (), getS (), getS ()); } diff --git a/gcc/testsuite/g++.dg/debug/pr71057.C b/gcc/testsuite/g++.dg/debug/pr71057.C index 2ed1eed988e..0bd546a74e8 100644 --- a/gcc/testsuite/g++.dg/debug/pr71057.C +++ b/gcc/testsuite/g++.dg/debug/pr71057.C @@ -9,4 +9,4 @@ template struct C { }; template struct D {}; C a; -D> fn1() { fn1, a; } +D> fn1() { fn1, a; return D>(); } diff --git a/gcc/testsuite/g++.dg/debug/pr71432.C b/gcc/testsuite/g++.dg/debug/pr71432.C index 1682f126f12..e9bc88ca863 100644 --- a/gcc/testsuite/g++.dg/debug/pr71432.C +++ b/gcc/testsuite/g++.dg/debug/pr71432.C @@ -105,9 +105,11 @@ namespace std public: size_type size ()const noexcept { + return 0; } const _CharT *data () const noexcept { + return 0; } }; } @@ -127,9 +129,14 @@ class CLIParameterType { const std::string & getSwitchOption (unsigned int i) const { - } unsigned int getSwitchOptionCount () const + static std::string a; + return a; + } + unsigned int getSwitchOptionCount () const { - } int checkSwitched (const std::string & value) const; + return 0; + } + int checkSwitched (const std::string & value) const; }; int @@ -138,4 +145,6 @@ CLIParameterType::checkSwitched (const std::string & value) const int contains = false; for (unsigned int i = 0; !contains && i < getSwitchOptionCount () ;) contains = getSwitchOption (i) == value; + + return 0; } diff --git a/gcc/testsuite/g++.dg/debug/pr80461.C b/gcc/testsuite/g++.dg/debug/pr80461.C index df7b4229ddf..b472e62c803 100644 --- a/gcc/testsuite/g++.dg/debug/pr80461.C +++ b/gcc/testsuite/g++.dg/debug/pr80461.C @@ -6,7 +6,7 @@ template class A; struct B { template - static bool foo (U T::*) {} + static bool foo (U T::*) { return true; } }; template class J; template diff --git a/gcc/testsuite/g++.dg/dfp/44473-1.C b/gcc/testsuite/g++.dg/dfp/44473-1.C index 38689fa165d..940638f4e9b 100644 --- a/gcc/testsuite/g++.dg/dfp/44473-1.C +++ b/gcc/testsuite/g++.dg/dfp/44473-1.C @@ -1,4 +1,5 @@ /* { dg-do assemble } */ +/* { dg-additional-options "-Wno-return-type" } */ /* Minimized from the testcase in PR c++/44473; mangling of decimal types did not include CV qualifiers. */ @@ -119,4 +120,5 @@ bool bar () { vec.push_back (std::decimal::decimal32 (0)); + return true; } diff --git a/gcc/testsuite/g++.dg/dfp/44473-2.C b/gcc/testsuite/g++.dg/dfp/44473-2.C index 311f62299b3..60fc1ebca9c 100644 --- a/gcc/testsuite/g++.dg/dfp/44473-2.C +++ b/gcc/testsuite/g++.dg/dfp/44473-2.C @@ -14,12 +14,12 @@ namespace std { } } -int bar (const std::decimal::decimal64 & x) { } +int bar (const std::decimal::decimal64 & x) { return 0; } int foo () { std::decimal::decimal64 x(0); - bar (x); + return bar (x); } // { dg-final { scan-assembler "_Z3barRKDd:" } } diff --git a/gcc/testsuite/g++.dg/eh/builtin1.C b/gcc/testsuite/g++.dg/eh/builtin1.C index 4aa70dacd3b..2d04d9c08e8 100644 --- a/gcc/testsuite/g++.dg/eh/builtin1.C +++ b/gcc/testsuite/g++.dg/eh/builtin1.C @@ -8,7 +8,7 @@ extern "C" int printf (const char *, ...); extern void callme (void) throw(); -int +void foo (int i) { try { @@ -18,7 +18,7 @@ foo (int i) } } -int +void bar (int i) { try { diff --git a/gcc/testsuite/g++.dg/eh/builtin2.C b/gcc/testsuite/g++.dg/eh/builtin2.C index a92477455e1..0c0bfe6a679 100644 --- a/gcc/testsuite/g++.dg/eh/builtin2.C +++ b/gcc/testsuite/g++.dg/eh/builtin2.C @@ -7,7 +7,7 @@ extern "C" int printf (const char *, ...) throw(); extern void callme (void) throw(); -int +void foo (int i) { try { @@ -17,7 +17,7 @@ foo (int i) } } -int +void bar (int i) { try { diff --git a/gcc/testsuite/g++.dg/eh/builtin3.C b/gcc/testsuite/g++.dg/eh/builtin3.C index b4a06726305..5b8c62b4b63 100644 --- a/gcc/testsuite/g++.dg/eh/builtin3.C +++ b/gcc/testsuite/g++.dg/eh/builtin3.C @@ -5,7 +5,7 @@ extern void callme (void) throw(); -int +void bar (int i) { try { diff --git a/gcc/testsuite/g++.dg/eh/pr45569.C b/gcc/testsuite/g++.dg/eh/pr45569.C index 2c100d2b9bf..4f67770b4a7 100644 --- a/gcc/testsuite/g++.dg/eh/pr45569.C +++ b/gcc/testsuite/g++.dg/eh/pr45569.C @@ -7,7 +7,7 @@ _Complex float g (); void i (_Complex float); -float j () +void j () { _Complex float x = 0; try diff --git a/gcc/testsuite/g++.dg/eh/unwind2.C b/gcc/testsuite/g++.dg/eh/unwind2.C index d6181c8c04b..8d98d3fd3d3 100644 --- a/gcc/testsuite/g++.dg/eh/unwind2.C +++ b/gcc/testsuite/g++.dg/eh/unwind2.C @@ -46,7 +46,7 @@ namespace typedef _CharT char_type; char_type * _M_in_beg; char_type *eback () { return _M_in_beg; } - char_type *gptr () {} + char_type *gptr () { return 0; } }; } namespace std diff --git a/gcc/testsuite/g++.dg/expr/bitfield11.C b/gcc/testsuite/g++.dg/expr/bitfield11.C index bab303ef36c..ddf48cb373a 100644 --- a/gcc/testsuite/g++.dg/expr/bitfield11.C +++ b/gcc/testsuite/g++.dg/expr/bitfield11.C @@ -6,7 +6,7 @@ struct A unsigned int a : 1; }; -bool +void foo (A *x, A *y) { x->a = y ? y->a : true; diff --git a/gcc/testsuite/g++.dg/expr/static_cast7.C b/gcc/testsuite/g++.dg/expr/static_cast7.C index bced805bcdb..2398bedf1b4 100644 --- a/gcc/testsuite/g++.dg/expr/static_cast7.C +++ b/gcc/testsuite/g++.dg/expr/static_cast7.C @@ -1,7 +1,7 @@ // Regression test for bug 39415 (and its duplicate 44916). struct S {}; struct T : S {}; -int f(const T*) {} +int f(const T*) { return 0; } void f(T*); int main() { S* s(0); diff --git a/gcc/testsuite/g++.dg/ext/altivec-14.C b/gcc/testsuite/g++.dg/ext/altivec-14.C index e5dd81c7553..02e8a23258d 100644 --- a/gcc/testsuite/g++.dg/ext/altivec-14.C +++ b/gcc/testsuite/g++.dg/ext/altivec-14.C @@ -5,7 +5,7 @@ void f (__attribute__((altivec (vector__))) signed int * a, __attribute__((altivec (vector__))) signed int * const b); -int +void foo (void) { __attribute__((altivec (vector__))) signed int a[1], b[1]; diff --git a/gcc/testsuite/g++.dg/ext/asm13.C b/gcc/testsuite/g++.dg/ext/asm13.C index eece05e0fb3..3e1fd4bbe48 100644 --- a/gcc/testsuite/g++.dg/ext/asm13.C +++ b/gcc/testsuite/g++.dg/ext/asm13.C @@ -1,6 +1,6 @@ // PR c++/69257 -int fn1() { +void fn1() { struct S *x; __asm ( "": :"" (*x)); // { dg-error "incomplete" } } diff --git a/gcc/testsuite/g++.dg/ext/builtin-object-size3.C b/gcc/testsuite/g++.dg/ext/builtin-object-size3.C index b2a9170fc30..1e158cd6d01 100644 --- a/gcc/testsuite/g++.dg/ext/builtin-object-size3.C +++ b/gcc/testsuite/g++.dg/ext/builtin-object-size3.C @@ -5,7 +5,7 @@ void baz (int *, int *); #define MEMCPY(d,s,l) __builtin___memcpy_chk (d, s, l, __builtin_object_size (d, 0)) // { dg-warning "writing" } -int +void foo () { int *p = new int; @@ -15,7 +15,7 @@ foo () baz (p, q); } -int +void bar () { int *p = new int; diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C b/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C index c2e99ef5444..594d3a98672 100644 --- a/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C +++ b/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C @@ -1,5 +1,7 @@ // PR c++/36870 // { dg-do run } + + #include struct S { const S& operator= (const S&); }; @@ -9,8 +11,9 @@ bool f (); int main () { assert (__has_nothrow_assign (S) == f ()); + return 0; } -const S& S::operator= (const S&) { } +const S& S::operator= (const S&a) { return a; } bool f () { return __has_nothrow_assign (S); } diff --git a/gcc/testsuite/g++.dg/ext/label7.C b/gcc/testsuite/g++.dg/ext/label7.C index e92dccf5df5..d74a66aa224 100644 --- a/gcc/testsuite/g++.dg/ext/label7.C +++ b/gcc/testsuite/g++.dg/ext/label7.C @@ -1,7 +1,7 @@ // PR c++/32121 // { dg-do compile } -int f (void) +void f (void) { a:; __label__ a; // { dg-error "not at the beginning" } diff --git a/gcc/testsuite/g++.dg/ext/label8.C b/gcc/testsuite/g++.dg/ext/label8.C index 1f6175df3a7..edffe35a6c6 100644 --- a/gcc/testsuite/g++.dg/ext/label8.C +++ b/gcc/testsuite/g++.dg/ext/label8.C @@ -1,7 +1,7 @@ // PR c++/32121 // { dg-do compile } -int f (void) +void f (void) { __label__ a, b; __label__ c; diff --git a/gcc/testsuite/g++.dg/ext/tmplattr7.C b/gcc/testsuite/g++.dg/ext/tmplattr7.C index ee6c4184768..545e089f1bb 100644 --- a/gcc/testsuite/g++.dg/ext/tmplattr7.C +++ b/gcc/testsuite/g++.dg/ext/tmplattr7.C @@ -8,4 +8,4 @@ bool test(const List &); int i = bar(List()); -bool test(const List &) {} +bool test(const List &) { return true; } diff --git a/gcc/testsuite/g++.dg/ext/vector8.C b/gcc/testsuite/g++.dg/ext/vector8.C index 5f9f9561d7f..49bdc5a5611 100644 --- a/gcc/testsuite/g++.dg/ext/vector8.C +++ b/gcc/testsuite/g++.dg/ext/vector8.C @@ -9,7 +9,7 @@ vector int a1; vector float b; vector int b1; -int f(void) +void f(void) { a = a | b; /* { dg-error "" } */ a = a & b; /* { dg-error "" } */ diff --git a/gcc/testsuite/g++.dg/ext/visibility/anon1.C b/gcc/testsuite/g++.dg/ext/visibility/anon1.C index 0135f931a6f..60a34db6ede 100644 --- a/gcc/testsuite/g++.dg/ext/visibility/anon1.C +++ b/gcc/testsuite/g++.dg/ext/visibility/anon1.C @@ -7,5 +7,5 @@ namespace { - int f() { } + int f() { return 0; } } diff --git a/gcc/testsuite/g++.dg/ext/visibility/anon2.C b/gcc/testsuite/g++.dg/ext/visibility/anon2.C index dcf0e64fa23..7abdd050518 100644 --- a/gcc/testsuite/g++.dg/ext/visibility/anon2.C +++ b/gcc/testsuite/g++.dg/ext/visibility/anon2.C @@ -9,4 +9,4 @@ namespace struct A { }; } -A f () { } +A f () { return A(); } diff --git a/gcc/testsuite/g++.dg/ext/visibility/namespace1.C b/gcc/testsuite/g++.dg/ext/visibility/namespace1.C index b7773dc9d61..1da1c14d254 100644 --- a/gcc/testsuite/g++.dg/ext/visibility/namespace1.C +++ b/gcc/testsuite/g++.dg/ext/visibility/namespace1.C @@ -10,7 +10,7 @@ namespace foo __attribute ((visibility ("hidden"))) { - int f() { } + int f() { return 0; } void g(); template void t() { } class A diff --git a/gcc/testsuite/g++.dg/ext/vla16.C b/gcc/testsuite/g++.dg/ext/vla16.C index c3e6ea1caba..fa51feed8f3 100644 --- a/gcc/testsuite/g++.dg/ext/vla16.C +++ b/gcc/testsuite/g++.dg/ext/vla16.C @@ -5,4 +5,6 @@ long fn1() { const int a = fn1(); int b[a]; int c = *(&b[0] + sizeof(0)); + + return 0; } diff --git a/gcc/testsuite/g++.dg/goacc/reference.C b/gcc/testsuite/g++.dg/goacc/reference.C index b000668b1aa..07e6bd42239 100644 --- a/gcc/testsuite/g++.dg/goacc/reference.C +++ b/gcc/testsuite/g++.dg/goacc/reference.C @@ -1,4 +1,4 @@ -int +void test1 (int &ref) { #pragma acc kernels copy (ref) @@ -7,7 +7,7 @@ test1 (int &ref) } } -int +void test2 (int &ref) { int b; diff --git a/gcc/testsuite/g++.dg/gomp/pr37189.C b/gcc/testsuite/g++.dg/gomp/pr37189.C index 31d95f2d2df..a83957ea2a3 100644 --- a/gcc/testsuite/g++.dg/gomp/pr37189.C +++ b/gcc/testsuite/g++.dg/gomp/pr37189.C @@ -18,7 +18,7 @@ bar (T &) { } -int +void foo () { T t; diff --git a/gcc/testsuite/g++.dg/gomp/pr39495-1.C b/gcc/testsuite/g++.dg/gomp/pr39495-1.C index 8563e684fff..dfa7db66d2c 100644 --- a/gcc/testsuite/g++.dg/gomp/pr39495-1.C +++ b/gcc/testsuite/g++.dg/gomp/pr39495-1.C @@ -6,7 +6,7 @@ #define INT_MAX __INT_MAX__ #define UINT_MAX (2U * __INT_MAX__ + 1) -int +void foo (void) { int i; @@ -50,7 +50,7 @@ foo (void) ; } -int +void bar (void) { int i; diff --git a/gcc/testsuite/g++.dg/gomp/pr39495-2.C b/gcc/testsuite/g++.dg/gomp/pr39495-2.C index c0b4d5dbdee..f8b0f23183c 100644 --- a/gcc/testsuite/g++.dg/gomp/pr39495-2.C +++ b/gcc/testsuite/g++.dg/gomp/pr39495-2.C @@ -6,7 +6,7 @@ #define INT_MAX __INT_MAX__ #define UINT_MAX (2U * __INT_MAX__ + 1) -int +void foo (void) { int i; diff --git a/gcc/testsuite/g++.dg/gomp/pr82054.C b/gcc/testsuite/g++.dg/gomp/pr82054.C index 3c6aa27c7f4..706dd836968 100644 --- a/gcc/testsuite/g++.dg/gomp/pr82054.C +++ b/gcc/testsuite/g++.dg/gomp/pr82054.C @@ -10,4 +10,6 @@ a::b () { #pragma omp parallel ; + + return true; } diff --git a/gcc/testsuite/g++.dg/inherit/covariant10.C b/gcc/testsuite/g++.dg/inherit/covariant10.C index fe5d03c27d3..6c31aaff03d 100644 --- a/gcc/testsuite/g++.dg/inherit/covariant10.C +++ b/gcc/testsuite/g++.dg/inherit/covariant10.C @@ -11,12 +11,12 @@ struct c1 { struct c5 {}; struct c6 : virtual c1 { - virtual c5* f33() const {} + virtual c5* f33() const { return 0; } }; struct c13 : virtual c5 { }; struct c17 : virtual c6 { - virtual c13* f33() const {} + virtual c13* f33() const { return 0; } }; diff --git a/gcc/testsuite/g++.dg/inherit/covariant11.C b/gcc/testsuite/g++.dg/inherit/covariant11.C index acba965f3af..97b8d13cfa5 100644 --- a/gcc/testsuite/g++.dg/inherit/covariant11.C +++ b/gcc/testsuite/g++.dg/inherit/covariant11.C @@ -7,19 +7,19 @@ struct c2 { int i; }; struct c1 { - virtual c2& f8() {} + virtual c2& f8() { static c2 a; return a; } }; struct c3 : c1, c2 { - virtual c2& f8() {} + virtual c2& f8() { static c2 a; return a; } }; struct c11 : public c1 { - virtual c3& f8() {} + virtual c3& f8() { static c3 a; return a; } }; struct c15 : virtual c3 { - virtual c2& f8() {} + virtual c2& f8() { static c3 a; return a; } }; struct c18 : virtual c11 { diff --git a/gcc/testsuite/g++.dg/inherit/protected1.C b/gcc/testsuite/g++.dg/inherit/protected1.C index c71be53331f..130b14ad863 100644 --- a/gcc/testsuite/g++.dg/inherit/protected1.C +++ b/gcc/testsuite/g++.dg/inherit/protected1.C @@ -9,6 +9,7 @@ template struct B > { A a; a.m_class->m_object; + return 0; } }; template class A @@ -23,6 +24,7 @@ bool A::operator== (const X &) const { B::check; + return true; } class C { diff --git a/gcc/testsuite/g++.dg/init/inline1.C b/gcc/testsuite/g++.dg/init/inline1.C index f3e323427d3..18d735fd87b 100644 --- a/gcc/testsuite/g++.dg/init/inline1.C +++ b/gcc/testsuite/g++.dg/init/inline1.C @@ -3,7 +3,7 @@ struct A { ~A(); - A f(A) { } + A f(A) { return A(); } }; diff --git a/gcc/testsuite/g++.dg/init/new18.C b/gcc/testsuite/g++.dg/init/new18.C index 45f6e7a095d..5f07aaa40d0 100644 --- a/gcc/testsuite/g++.dg/init/new18.C +++ b/gcc/testsuite/g++.dg/init/new18.C @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "-O2 -fstrict-aliasing" } +// { dg-additional-options "-Wno-return-type" } // This caused an ICE during placement new. diff --git a/gcc/testsuite/g++.dg/init/reference2.C b/gcc/testsuite/g++.dg/init/reference2.C index 42f53742685..903c06496d5 100644 --- a/gcc/testsuite/g++.dg/init/reference2.C +++ b/gcc/testsuite/g++.dg/init/reference2.C @@ -5,7 +5,7 @@ // We should we able to diagnostic this without instantiating the template template -int f() +void f() { typedef int& T; T a = T(); // { dg-error "value-initialization of reference" } diff --git a/gcc/testsuite/g++.dg/init/reference3.C b/gcc/testsuite/g++.dg/init/reference3.C index 8cc5afd6f4c..52ae935ca79 100644 --- a/gcc/testsuite/g++.dg/init/reference3.C +++ b/gcc/testsuite/g++.dg/init/reference3.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } // This code used to be accepted but it is invalid as there is no // value initialization of a reference type. // PR c++/36695 diff --git a/gcc/testsuite/g++.dg/init/switch1.C b/gcc/testsuite/g++.dg/init/switch1.C index b0b06b748f8..a964a29df58 100644 --- a/gcc/testsuite/g++.dg/init/switch1.C +++ b/gcc/testsuite/g++.dg/init/switch1.C @@ -1,4 +1,4 @@ -int f(int c) +void f(int c) { switch (c) { diff --git a/gcc/testsuite/g++.dg/ipa/devirt-10.C b/gcc/testsuite/g++.dg/ipa/devirt-10.C index faab5121695..84120e791f9 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-10.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-10.C @@ -4,7 +4,7 @@ class wxPaintEvent { }; struct wxDCBase { wxDCBase (); - virtual int GetLayoutDirection() const{} + virtual int GetLayoutDirection() const{ return 0; } virtual void SetLayoutDirection(int){} }; struct wxWindowDC : public wxDCBase {}; diff --git a/gcc/testsuite/g++.dg/ipa/devirt-13.C b/gcc/testsuite/g++.dg/ipa/devirt-13.C index fecbbfc93eb..923c98e92eb 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-13.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-13.C @@ -11,7 +11,8 @@ public: }; } class A a, *b=&a; -main() + +int main() { return b->foo(); } diff --git a/gcc/testsuite/g++.dg/ipa/devirt-14.C b/gcc/testsuite/g++.dg/ipa/devirt-14.C index 1437e7e472b..5efbe68bf03 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-14.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-14.C @@ -20,7 +20,8 @@ public: }; } class B a, *b=&a; -main() + +int main() { if (0) { diff --git a/gcc/testsuite/g++.dg/ipa/devirt-15.C b/gcc/testsuite/g++.dg/ipa/devirt-15.C index bf9f2985a34..4a899d4178a 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-15.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-15.C @@ -30,7 +30,7 @@ m(void) { b->foo(); } -main() +int main() { m(); } diff --git a/gcc/testsuite/g++.dg/ipa/devirt-16.C b/gcc/testsuite/g++.dg/ipa/devirt-16.C index 698e3e8ff35..762ecb29fde 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-16.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-16.C @@ -19,7 +19,7 @@ public: }; } class B *b; -main() +int main() { int c; if (c) diff --git a/gcc/testsuite/g++.dg/ipa/devirt-17.C b/gcc/testsuite/g++.dg/ipa/devirt-17.C index bbbd23c0bad..9edc205ce52 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-17.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-17.C @@ -20,7 +20,7 @@ public: } class B *b; void get_me_lost (void *); -main() +int main() { int c; if (c) diff --git a/gcc/testsuite/g++.dg/ipa/devirt-18.C b/gcc/testsuite/g++.dg/ipa/devirt-18.C index 066b775e00c..769e0bbc888 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-18.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-18.C @@ -19,7 +19,7 @@ public: }; } class B *b; -main() +int main() { if (0) { diff --git a/gcc/testsuite/g++.dg/ipa/devirt-19.C b/gcc/testsuite/g++.dg/ipa/devirt-19.C index fd167b6f373..8277deaabdd 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-19.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-19.C @@ -3,6 +3,8 @@ a type change. */ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-ipa-cp" } */ +/* { dg-additional-options "-Wno-return-type" } */ + struct A { void operator==(const A &); }; diff --git a/gcc/testsuite/g++.dg/ipa/devirt-21.C b/gcc/testsuite/g++.dg/ipa/devirt-21.C index 440570c8ddb..aa0488df92d 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-21.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-21.C @@ -33,7 +33,7 @@ MultiTermDocs::~MultiTermDocs() { B *C::m_fn1(int *) { abort (); } -main() +int main() { class C c; } diff --git a/gcc/testsuite/g++.dg/ipa/devirt-23.C b/gcc/testsuite/g++.dg/ipa/devirt-23.C index 76fc3fde42b..15e65b579f7 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-23.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-23.C @@ -41,7 +41,7 @@ MultiTermDocs::~MultiTermDocs() { B *C::m_fn1(int *) { abort (); } -main() +int main() { class C c; } diff --git a/gcc/testsuite/g++.dg/ipa/devirt-38.C b/gcc/testsuite/g++.dg/ipa/devirt-38.C index 40deb039e7a..fdb5c623533 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-38.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-38.C @@ -12,7 +12,7 @@ class A : public SnmpSyntax { public: A (int); - SnmpSyntax *m_fn1 () const {} + SnmpSyntax *m_fn1 () const { return 0; } SnmpSyntax &operator=(const SnmpSyntax &); }; int a; diff --git a/gcc/testsuite/g++.dg/ipa/devirt-40.C b/gcc/testsuite/g++.dg/ipa/devirt-40.C index 5107c290c63..32e0d22c0e7 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-40.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-40.C @@ -13,10 +13,14 @@ class A UnicodeString &m_fn1 (UnicodeString &, int &p2, UErrorCode &) const; }; UnicodeString::UnicodeString () {} + +UnicodeString g; + UnicodeString & A::m_fn1 (UnicodeString &, int &p2, UErrorCode &) const { UnicodeString a[2]; + return g; } /* { dg-final { scan-tree-dump-not "\\n OBJ_TYPE_REF" "fre3" } } */ diff --git a/gcc/testsuite/g++.dg/ipa/devirt-41.C b/gcc/testsuite/g++.dg/ipa/devirt-41.C index d8182baae6e..149da911b25 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-41.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-41.C @@ -13,7 +13,7 @@ test (struct A *a) __builtin_abort (); } -main() +int main() { struct B a; dostuff (&a); diff --git a/gcc/testsuite/g++.dg/ipa/devirt-42.C b/gcc/testsuite/g++.dg/ipa/devirt-42.C index 6fecfe73bec..152b9689dc4 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-42.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-42.C @@ -16,7 +16,7 @@ A::barbar() return static_cast(this)->barbar(); } -main() +int main() { struct B b; struct A *a = &b; diff --git a/gcc/testsuite/g++.dg/ipa/devirt-44.C b/gcc/testsuite/g++.dg/ipa/devirt-44.C index f69e1aa08ac..5de761412d0 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-44.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-44.C @@ -2,7 +2,7 @@ /* { dg-options "-O3 -fno-ipa-cp -fdump-ipa-inline-details -fno-early-inlining" } */ struct A { virtual int foo () {return 1;} - int wrapfoo () {foo();} + void wrapfoo () {foo();} A() {wrapfoo();} }; struct B:A {virtual int foo () {return 2;}}; @@ -17,7 +17,7 @@ test (struct A *a) __builtin_abort (); } -main() +int main() { struct B a; dostuff (&a); diff --git a/gcc/testsuite/g++.dg/ipa/devirt-45.C b/gcc/testsuite/g++.dg/ipa/devirt-45.C index 57449b702d3..ce415e7c003 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-45.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-45.C @@ -2,7 +2,7 @@ /* { dg-options "-O3 -fno-ipa-cp -fdump-ipa-inline-details -fno-early-inlining" } */ struct A { virtual int foo () {return 1;} - int wrapfoo () {foo();} + void wrapfoo () {foo();} A() {wrapfoo();} }; inline void* operator new(__SIZE_TYPE__ s, void* buf) throw() { @@ -29,7 +29,7 @@ test (struct A *a) test2(a); } -main() +int main() { struct B a; dostuff (&a); diff --git a/gcc/testsuite/g++.dg/ipa/devirt-48.C b/gcc/testsuite/g++.dg/ipa/devirt-48.C index eae93ece71c..1aed85f8642 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-48.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-48.C @@ -5,14 +5,14 @@ struct A { }; struct B:A { virtual int foo(){return 2;} - int callfoo(){foo();} + void callfoo(){foo();} }; struct C:A { virtual int foo(){return 3;} }; struct D:B { virtual int foo(){return 4;} - int callfoo(){foo();} + void callfoo(){foo();} }; static void test (struct A *a) diff --git a/gcc/testsuite/g++.dg/ipa/devirt-52.C b/gcc/testsuite/g++.dg/ipa/devirt-52.C index be0ab4c3621..5c736c4037a 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-52.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-52.C @@ -1,6 +1,7 @@ // PR middle-end/77259 // { dg-do compile { target c++11 } } // { dg-options "-O2" } +// { dg-additional-options "-Wno-return-type" } template class A; template struct A diff --git a/gcc/testsuite/g++.dg/ipa/nothrow-1.C b/gcc/testsuite/g++.dg/ipa/nothrow-1.C index df2fbae2acc..b30b0215924 100644 --- a/gcc/testsuite/g++.dg/ipa/nothrow-1.C +++ b/gcc/testsuite/g++.dg/ipa/nothrow-1.C @@ -11,7 +11,7 @@ int a(void) { return *ptr == *ptr; } -main() +int main() { int aa; ptr = &barvar; diff --git a/gcc/testsuite/g++.dg/ipa/pr43812.C b/gcc/testsuite/g++.dg/ipa/pr43812.C index cc46eed6501..32d997b927d 100644 --- a/gcc/testsuite/g++.dg/ipa/pr43812.C +++ b/gcc/testsuite/g++.dg/ipa/pr43812.C @@ -35,4 +35,4 @@ public: class LocalSurface : public Surface { virtual BBox bbox () const; }; -BBox LocalSurface::bbox () const { } +BBox LocalSurface::bbox () const { return BBox(); } diff --git a/gcc/testsuite/g++.dg/ipa/pr44372.C b/gcc/testsuite/g++.dg/ipa/pr44372.C index 22aa747e435..dbdd865cfb6 100644 --- a/gcc/testsuite/g++.dg/ipa/pr44372.C +++ b/gcc/testsuite/g++.dg/ipa/pr44372.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O -fipa-cp -fipa-cp-clone" } */ +/* { dg-additional-options "-Wno-return-type" } */ template < typename > class S3; diff --git a/gcc/testsuite/g++.dg/ipa/pr45572-1.C b/gcc/testsuite/g++.dg/ipa/pr45572-1.C index 82f347052d5..03a299ff422 100644 --- a/gcc/testsuite/g++.dg/ipa/pr45572-1.C +++ b/gcc/testsuite/g++.dg/ipa/pr45572-1.C @@ -11,18 +11,22 @@ typedef struct extern __inline __attribute__ ((__gnu_inline__)) int fgetc_unlocked (FILE *__fp) { + return 0; } extern __inline __attribute__ ((__gnu_inline__)) int putc_unlocked (int __c, FILE *__stream) { + return 0; } extern __inline __attribute__ ((__gnu_inline__)) __ssize_t getline (char **__lineptr, size_t *__n, FILE *__stream) { + return 0; } extern __inline __attribute__ ((__gnu_inline__)) int ferror_unlocked (FILE *__stream) throw () { + return 0; } } typedef struct diff --git a/gcc/testsuite/g++.dg/ipa/pr58371.C b/gcc/testsuite/g++.dg/ipa/pr58371.C index 00cfbb831fc..cfcf677e3d0 100644 --- a/gcc/testsuite/g++.dg/ipa/pr58371.C +++ b/gcc/testsuite/g++.dg/ipa/pr58371.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ +/* { dg-additional-options "-Wno-return-type" } */ typedef int size_t; diff --git a/gcc/testsuite/g++.dg/ipa/pr59176.C b/gcc/testsuite/g++.dg/ipa/pr59176.C index d576bc3ba5a..379719708ac 100644 --- a/gcc/testsuite/g++.dg/ipa/pr59176.C +++ b/gcc/testsuite/g++.dg/ipa/pr59176.C @@ -33,9 +33,11 @@ class C { unsigned long C::m_fn1() { CellHierarchy: m_fn2().m_fn1(); + return 0; } unsigned long C::m_fn3() { CellHierarchy: m_fn2().m_fn1(); + return 0; } diff --git a/gcc/testsuite/g++.dg/ipa/pr60640-1.C b/gcc/testsuite/g++.dg/ipa/pr60640-1.C index 7a0b91893f8..2e626126d07 100644 --- a/gcc/testsuite/g++.dg/ipa/pr60640-1.C +++ b/gcc/testsuite/g++.dg/ipa/pr60640-1.C @@ -25,7 +25,7 @@ class D : ASN1Object, public B }; class G : public D { - unsigned m_fn1 (bool) const {} + unsigned m_fn1 (bool) const { return 0; } }; class F : A { diff --git a/gcc/testsuite/g++.dg/ipa/pr61540.C b/gcc/testsuite/g++.dg/ipa/pr61540.C index e7dee7262c1..e297fe360dc 100644 --- a/gcc/testsuite/g++.dg/ipa/pr61540.C +++ b/gcc/testsuite/g++.dg/ipa/pr61540.C @@ -6,7 +6,7 @@ struct data { }; struct top { - virtual int topf() {} + virtual int topf() { return 0; } }; struct intermediate: top { diff --git a/gcc/testsuite/g++.dg/ipa/pr63470.C b/gcc/testsuite/g++.dg/ipa/pr63470.C index e6fa73bcd4c..ffef0a284de 100644 --- a/gcc/testsuite/g++.dg/ipa/pr63470.C +++ b/gcc/testsuite/g++.dg/ipa/pr63470.C @@ -17,6 +17,7 @@ class FTjackSupport : A const char ** m_fn2 (int) { + return 0; } int _inited; int *_jackClient; diff --git a/gcc/testsuite/g++.dg/ipa/pr63587-1.C b/gcc/testsuite/g++.dg/ipa/pr63587-1.C index cbf872e2969..a727b9e9e4c 100644 --- a/gcc/testsuite/g++.dg/ipa/pr63587-1.C +++ b/gcc/testsuite/g++.dg/ipa/pr63587-1.C @@ -61,6 +61,7 @@ I<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos ( const key_type &p1) { _M_impl._M_key_compare (p1, 0); + return A(); } template @@ -69,6 +70,7 @@ I<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_hint_unique_pos ( H &) { _M_get_insert_unique_pos (0); + return A(); } template @@ -78,6 +80,7 @@ I<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_emplace_hint_unique ( H p1, _Args &&...) { _M_get_insert_hint_unique_pos (p1); + return 0; } namespace { struct L; diff --git a/gcc/testsuite/g++.dg/ipa/pr63587-2.C b/gcc/testsuite/g++.dg/ipa/pr63587-2.C index a15f17e7ca3..7a9b2454507 100644 --- a/gcc/testsuite/g++.dg/ipa/pr63587-2.C +++ b/gcc/testsuite/g++.dg/ipa/pr63587-2.C @@ -1,6 +1,7 @@ // PR ipa/63587 // { dg-do compile { target c++11 } } // { dg-options "-O2" } +// { dg-additional-options "-Wno-return-type" } namespace boost { class basic_cstring @@ -22,6 +23,7 @@ template struct function_obj_invoker0 { FunctionObj f; f (); + return 0; } }; template struct get_function_obj_invoker0 diff --git a/gcc/testsuite/g++.dg/ipa/pr63838.C b/gcc/testsuite/g++.dg/ipa/pr63838.C index fb68c9f1ac8..d23b3133748 100644 --- a/gcc/testsuite/g++.dg/ipa/pr63838.C +++ b/gcc/testsuite/g++.dg/ipa/pr63838.C @@ -27,7 +27,7 @@ bar (int x) fn (); } -__attribute__((noinline, noclone)) int +__attribute__((noinline, noclone)) void baz (int x) { S s; diff --git a/gcc/testsuite/g++.dg/ipa/pr63894.C b/gcc/testsuite/g++.dg/ipa/pr63894.C index 54409752758..fad02c36acc 100644 --- a/gcc/testsuite/g++.dg/ipa/pr63894.C +++ b/gcc/testsuite/g++.dg/ipa/pr63894.C @@ -43,4 +43,5 @@ J::m_fn3 (G *p1) p1->m_fn1 (0, D (0, D::BOX, 0)); K *d = new (0) K (0, m_fn2 (0)); m_fn3 (d); + return true; } diff --git a/gcc/testsuite/g++.dg/ipa/pr64068.C b/gcc/testsuite/g++.dg/ipa/pr64068.C index 95288836c36..008fab1e1e6 100644 --- a/gcc/testsuite/g++.dg/ipa/pr64068.C +++ b/gcc/testsuite/g++.dg/ipa/pr64068.C @@ -3,12 +3,12 @@ typedef int PROV_ENUMALGS_EX, PCCRYPT_OID_INFO; class A { - int m_fn2(); + void m_fn2(); virtual bool m_fn1(PCCRYPT_OID_INFO); }; int fn1(); void fn2(); -int A::m_fn2() { m_fn1(0); } +void A::m_fn2() { m_fn1(0); } bool fn3() { for (;;) { @@ -27,7 +27,7 @@ public: B() { fn3(); } }; class C : A { - bool m_fn1(PCCRYPT_OID_INFO) { m_fn3(); } + bool m_fn1(PCCRYPT_OID_INFO) { m_fn3(); return true; } int isSupportedByProvider_algId; PROV_ENUMALGS_EX isSupportedByProvider_outEnumAlgs; PROV_ENUMALGS_EX isSupportedByProvider_enumAlgs; diff --git a/gcc/testsuite/g++.dg/ipa/pr64896.C b/gcc/testsuite/g++.dg/ipa/pr64896.C index 0a78220be8a..7064cd05f9d 100644 --- a/gcc/testsuite/g++.dg/ipa/pr64896.C +++ b/gcc/testsuite/g++.dg/ipa/pr64896.C @@ -5,9 +5,9 @@ struct A { int a, b; }; struct B { A c; int d; }; struct C { virtual B fn1 () const; }; -struct D { B fn2 () const; int fn3 () const; C *fn4 () const; }; +struct D { B fn2 () const; void fn3 () const; C *fn4 () const; }; -int +void D::fn3 () const { fn4 ()->fn1 (); diff --git a/gcc/testsuite/g++.dg/ipa/pr65002.C b/gcc/testsuite/g++.dg/ipa/pr65002.C index ac7c66bd19a..b505ac82c54 100644 --- a/gcc/testsuite/g++.dg/ipa/pr65002.C +++ b/gcc/testsuite/g++.dg/ipa/pr65002.C @@ -10,12 +10,12 @@ using fastmath::floor; class A { public: A(int, int); - virtual int m_fn1(float) const; + virtual void m_fn1(float) const; }; class B : A { public: B(int, int p2) : A(entity, p2) {} - int m_fn1(float p1) const { long b(floor(p1)); } + void m_fn1(float p1) const { long b(floor(p1)); } int entity; }; diff --git a/gcc/testsuite/g++.dg/ipa/pr65008.C b/gcc/testsuite/g++.dg/ipa/pr65008.C index 29b3a2f161f..84f10bb276c 100644 --- a/gcc/testsuite/g++.dg/ipa/pr65008.C +++ b/gcc/testsuite/g++.dg/ipa/pr65008.C @@ -8,7 +8,7 @@ struct A virtual void foo () {} }; -static inline int __attribute__ ((always_inline)) call_foo (A *a) +static inline void __attribute__ ((always_inline)) call_foo (A *a) { a->foo (); } diff --git a/gcc/testsuite/g++.dg/ipa/pr65465.C b/gcc/testsuite/g++.dg/ipa/pr65465.C index 436d88f743f..9c7d026b14a 100644 --- a/gcc/testsuite/g++.dg/ipa/pr65465.C +++ b/gcc/testsuite/g++.dg/ipa/pr65465.C @@ -4,7 +4,7 @@ struct A {}; struct B { virtual A foo () const; }; struct C { A foo () const; }; -struct D : virtual B { A foo () const {} }; +struct D : virtual B { A foo () const { return A(); } }; struct F : D { virtual int bar () const; }; int F::bar () const { return 0; } A C::foo () const { return A (); } diff --git a/gcc/testsuite/g++.dg/ipa/pr66896.C b/gcc/testsuite/g++.dg/ipa/pr66896.C index 236537a5ea0..841515c846f 100644 --- a/gcc/testsuite/g++.dg/ipa/pr66896.C +++ b/gcc/testsuite/g++.dg/ipa/pr66896.C @@ -9,7 +9,7 @@ struct A int *a; A (); ~A () { a3 (); } - int a1 (int * p) { if (!p) f3 (); f2 (p); } + void a1 (int * p) { if (!p) f3 (); f2 (p); } void a3 () { if (*a) a1 (a); } }; diff --git a/gcc/testsuite/g++.dg/ipa/pr68851.C b/gcc/testsuite/g++.dg/ipa/pr68851.C index 659e4cdcc4a..73096969eb6 100644 --- a/gcc/testsuite/g++.dg/ipa/pr68851.C +++ b/gcc/testsuite/g++.dg/ipa/pr68851.C @@ -8,7 +8,7 @@ public: }; class A { public: - virtual bool isFormControlElement() const {} + virtual bool isFormControlElement() const { return false; } }; class C { struct D { @@ -20,10 +20,10 @@ class F { virtual bool isFormControlElement() const; }; class G : A, F { - bool isFormControlElement() const {} + bool isFormControlElement() const { return true; } }; bool C::checkPseudoClass(const D &p1, int &) const { A &a = *p1.element; a.isFormControlElement(); - a.isFormControlElement() || a.isFormControlElement(); + return a.isFormControlElement() || a.isFormControlElement(); } diff --git a/gcc/testsuite/g++.dg/ipa/pr78211.C b/gcc/testsuite/g++.dg/ipa/pr78211.C index 8207a6bf7fb..510fca573de 100644 --- a/gcc/testsuite/g++.dg/ipa/pr78211.C +++ b/gcc/testsuite/g++.dg/ipa/pr78211.C @@ -1,6 +1,7 @@ // PR lto/78211 // { dg-do compile { target { lto && c++11 } } } // { dg-options "-fcompare-debug -fno-printf-return-value -flto -fno-use-linker-plugin -O3" } +// { dg-additional-options "-Wno-return-type" } namespace std { typedef __SIZE_TYPE__ size_t; @@ -37,7 +38,7 @@ namespace __gnu_cxx { reference operator*() const noexcept { } }; template - inline bool operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) noexcept { } + inline bool operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) noexcept { return true; } } namespace std { template struct char_traits; diff --git a/gcc/testsuite/g++.dg/ipa/pr79931.C b/gcc/testsuite/g++.dg/ipa/pr79931.C index 78f6e03c458..c5f6816a70f 100644 --- a/gcc/testsuite/g++.dg/ipa/pr79931.C +++ b/gcc/testsuite/g++.dg/ipa/pr79931.C @@ -21,4 +21,5 @@ NodeImpl *AttrImpl::insertBefore(NodeImpl *newChild, NodeImpl *refChild) { NodeImpl *oldparent = newChild->getParentNode(); oldparent->removeChild(newChild); this->getOwnerDocument()->getRanges(); + return 0; } diff --git a/gcc/testsuite/g++.dg/ipa/pure-const-1.C b/gcc/testsuite/g++.dg/ipa/pure-const-1.C index a219c713077..61940c670e7 100644 --- a/gcc/testsuite/g++.dg/ipa/pure-const-1.C +++ b/gcc/testsuite/g++.dg/ipa/pure-const-1.C @@ -11,7 +11,7 @@ int a(void) { return *ptr == *ptr; } -main() +int main() { int aa; ptr = &barvar; diff --git a/gcc/testsuite/g++.dg/ipa/pure-const-2.C b/gcc/testsuite/g++.dg/ipa/pure-const-2.C index 9788b8acdd8..6e739de4ade 100644 --- a/gcc/testsuite/g++.dg/ipa/pure-const-2.C +++ b/gcc/testsuite/g++.dg/ipa/pure-const-2.C @@ -15,7 +15,7 @@ static int b(void) { return a(); } -main() +int main() { int aa; ptr = &barvar; diff --git a/gcc/testsuite/g++.dg/ipa/pure-const-3.C b/gcc/testsuite/g++.dg/ipa/pure-const-3.C index ff7fe53f335..4cf9a6a9306 100644 --- a/gcc/testsuite/g++.dg/ipa/pure-const-3.C +++ b/gcc/testsuite/g++.dg/ipa/pure-const-3.C @@ -21,7 +21,7 @@ static int b(int p) return a(p+1); return 1; } -main() +int main() { int aa; ptr = &barvar; diff --git a/gcc/testsuite/g++.dg/ipa/remref-1.C b/gcc/testsuite/g++.dg/ipa/remref-1.C index c25c425e9b7..a2c316aa9a9 100644 --- a/gcc/testsuite/g++.dg/ipa/remref-1.C +++ b/gcc/testsuite/g++.dg/ipa/remref-1.C @@ -28,7 +28,7 @@ allocate_a () a = new A(); } -main() +int main() { allocate_a(); for (int i=0; i<10000;i++) diff --git a/gcc/testsuite/g++.dg/ipa/remref-2.C b/gcc/testsuite/g++.dg/ipa/remref-2.C index 06bc71a5b00..1cece6541c9 100644 --- a/gcc/testsuite/g++.dg/ipa/remref-2.C +++ b/gcc/testsuite/g++.dg/ipa/remref-2.C @@ -29,7 +29,7 @@ allocate_a () a = new A(); } -main() +int main() { allocate_a(); for (int i=0; i<10000;i++) diff --git a/gcc/testsuite/g++.dg/lookup/builtin2.C b/gcc/testsuite/g++.dg/lookup/builtin2.C index be0a6f65d6c..4649737c3d0 100644 --- a/gcc/testsuite/g++.dg/lookup/builtin2.C +++ b/gcc/testsuite/g++.dg/lookup/builtin2.C @@ -14,6 +14,6 @@ namespace std using ::toupper; } -int f () { +void f () { std::toupper((signed int)'a'); } diff --git a/gcc/testsuite/g++.dg/lookup/crash3.C b/gcc/testsuite/g++.dg/lookup/crash3.C index 5b58e8ed559..1b78dd607f3 100644 --- a/gcc/testsuite/g++.dg/lookup/crash3.C +++ b/gcc/testsuite/g++.dg/lookup/crash3.C @@ -4,12 +4,12 @@ typedef __SIZE_TYPE__ size_t; -struct A { void *operator new(size_t s){} }; // { dg-message "operator new" } -struct B { void *operator new(size_t s){} }; // { dg-message "operator new" } +struct A { void *operator new(size_t s){ return 0; } }; // { dg-message "operator new" } +struct B { void *operator new(size_t s){ return 0; } }; // { dg-message "operator new" } struct C : A,B {}; -int crash() +void crash() { C *c=new C(); // { dg-error "ambiguous" } } diff --git a/gcc/testsuite/g++.dg/lookup/friend20.C b/gcc/testsuite/g++.dg/lookup/friend20.C index ecdc763ca06..8ef23a67179 100644 --- a/gcc/testsuite/g++.dg/lookup/friend20.C +++ b/gcc/testsuite/g++.dg/lookup/friend20.C @@ -12,5 +12,6 @@ template class a a<> d () { + return a<>(); } }; diff --git a/gcc/testsuite/g++.dg/lookup/pr80891-5.C b/gcc/testsuite/g++.dg/lookup/pr80891-5.C index ebf64f8758e..e018922d68b 100644 --- a/gcc/testsuite/g++.dg/lookup/pr80891-5.C +++ b/gcc/testsuite/g++.dg/lookup/pr80891-5.C @@ -51,6 +51,7 @@ int vf2_subgraph_iso(GraphSmall, GraphLarge, SubGraphIsoMapCallback p3, IndexMapSmall, IndexMapLarge, VertexOrderSmall, EdgeEquivalencePredicate, VertexEquivalencePredicate) { vf2_subgraph_morphism(0, 0, p3, 0, 0, 0, 0, 0); + return 0; } } using namespace boost; diff --git a/gcc/testsuite/g++.dg/lookup/struct2.C b/gcc/testsuite/g++.dg/lookup/struct2.C index a66f403c291..a63e03dffdc 100644 --- a/gcc/testsuite/g++.dg/lookup/struct2.C +++ b/gcc/testsuite/g++.dg/lookup/struct2.C @@ -4,4 +4,4 @@ struct c {}; namespace A { int c(struct c*req); } -int A::c(struct c*req) {} +int A::c(struct c*req) { return 0; } diff --git a/gcc/testsuite/g++.dg/lto/20080709_0.C b/gcc/testsuite/g++.dg/lto/20080709_0.C index 55ae8c9ec2c..c9e81b44e2c 100644 --- a/gcc/testsuite/g++.dg/lto/20080709_0.C +++ b/gcc/testsuite/g++.dg/lto/20080709_0.C @@ -4,6 +4,7 @@ class Init { }; int f(Init *a) { + return 0; } int main(void){ diff --git a/gcc/testsuite/g++.dg/lto/20080907_0.C b/gcc/testsuite/g++.dg/lto/20080907_0.C index 9a4552310d9..a423196e7db 100644 --- a/gcc/testsuite/g++.dg/lto/20080907_0.C +++ b/gcc/testsuite/g++.dg/lto/20080907_0.C @@ -1,3 +1,5 @@ // { dg-lto-do assemble } +// { dg-lto-options "-Wno-return-type" } + struct Foo { void func (); }; Foo & bar () { } struct Baz { Baz (Baz &); }; Baz dummy() { bar().func(); } diff --git a/gcc/testsuite/g++.dg/lto/20080915_0.C b/gcc/testsuite/g++.dg/lto/20080915_0.C index 3789765a964..40c50422857 100644 --- a/gcc/testsuite/g++.dg/lto/20080915_0.C +++ b/gcc/testsuite/g++.dg/lto/20080915_0.C @@ -1,4 +1,6 @@ // { dg-lto-do assemble } +// { dg-lto-options "-Wno-return-type" } + struct Foo { static const int dummy; @@ -16,7 +18,7 @@ int func(const Bar& b) { } struct Baz { - Bar& operator*() {} + Bar& operator*() { static Bar a; return a; } }; void func1(Baz baz, int i, Bar bar) { diff --git a/gcc/testsuite/g++.dg/lto/20080916_0.C b/gcc/testsuite/g++.dg/lto/20080916_0.C index 3c900cd43b5..77494ef689c 100644 --- a/gcc/testsuite/g++.dg/lto/20080916_0.C +++ b/gcc/testsuite/g++.dg/lto/20080916_0.C @@ -9,4 +9,6 @@ class ios_base { }; ios_base& g() { + static ios_base a; + return a; } diff --git a/gcc/testsuite/g++.dg/lto/20081022_0.C b/gcc/testsuite/g++.dg/lto/20081022_0.C index 219f92d6a96..92d463b1cde 100644 --- a/gcc/testsuite/g++.dg/lto/20081022_0.C +++ b/gcc/testsuite/g++.dg/lto/20081022_0.C @@ -6,6 +6,8 @@ f (foo * a) return a->bar (); } +int main() { + return 0; } diff --git a/gcc/testsuite/g++.dg/lto/20081023_0.C b/gcc/testsuite/g++.dg/lto/20081023_0.C index ab3fc36f386..d40ac279b77 100644 --- a/gcc/testsuite/g++.dg/lto/20081023_0.C +++ b/gcc/testsuite/g++.dg/lto/20081023_0.C @@ -9,6 +9,8 @@ f (void) func (); } +int main() { + return 0; } diff --git a/gcc/testsuite/g++.dg/lto/20081118_0.C b/gcc/testsuite/g++.dg/lto/20081118_0.C index 7be32b6e2a7..c1f9dfc97a4 100644 --- a/gcc/testsuite/g++.dg/lto/20081118_0.C +++ b/gcc/testsuite/g++.dg/lto/20081118_0.C @@ -18,4 +18,5 @@ class foo : public object int foo::method(void) { + return 0; } diff --git a/gcc/testsuite/g++.dg/lto/20081118_1.C b/gcc/testsuite/g++.dg/lto/20081118_1.C index a1bf08186df..ee870a2eb75 100644 --- a/gcc/testsuite/g++.dg/lto/20081118_1.C +++ b/gcc/testsuite/g++.dg/lto/20081118_1.C @@ -18,4 +18,5 @@ bar* bar::method (void) { quxx::method(); + return 0; } diff --git a/gcc/testsuite/g++.dg/lto/20081120-1_0.C b/gcc/testsuite/g++.dg/lto/20081120-1_0.C index 6827337787c..03a9740c091 100644 --- a/gcc/testsuite/g++.dg/lto/20081120-1_0.C +++ b/gcc/testsuite/g++.dg/lto/20081120-1_0.C @@ -4,6 +4,7 @@ extern "C" { extern __inline __attribute__((__gnu_inline__)) int pthread_equal(int, int) { + return 0; } } static __typeof(pthread_equal) diff --git a/gcc/testsuite/g++.dg/lto/20081120-1_1.C b/gcc/testsuite/g++.dg/lto/20081120-1_1.C index e7e24a58b76..9c5d9bd6f4c 100644 --- a/gcc/testsuite/g++.dg/lto/20081120-1_1.C +++ b/gcc/testsuite/g++.dg/lto/20081120-1_1.C @@ -2,6 +2,7 @@ extern "C" { extern __inline __attribute__((__gnu_inline__)) int pthread_equal(int, int) { + return 0; } } static __typeof(pthread_equal) diff --git a/gcc/testsuite/g++.dg/lto/20081127_1.C b/gcc/testsuite/g++.dg/lto/20081127_1.C index 6488ac8d797..63ae50c31ec 100644 --- a/gcc/testsuite/g++.dg/lto/20081127_1.C +++ b/gcc/testsuite/g++.dg/lto/20081127_1.C @@ -1,3 +1,3 @@ struct Foo { Foo(); }; Foo::Foo() { } -main() { return 0; } +int main() { return 0; } diff --git a/gcc/testsuite/g++.dg/lto/20081217-2_0.C b/gcc/testsuite/g++.dg/lto/20081217-2_0.C index a47b0b5781b..3bc6ba997a5 100644 --- a/gcc/testsuite/g++.dg/lto/20081217-2_0.C +++ b/gcc/testsuite/g++.dg/lto/20081217-2_0.C @@ -1,5 +1,5 @@ struct A { - virtual int foo() {} + virtual int foo() { return 0; } }; struct B { virtual int f() {return 1; } @@ -13,6 +13,7 @@ C::C() { } +int main() { C c; diff --git a/gcc/testsuite/g++.dg/lto/20090303_0.C b/gcc/testsuite/g++.dg/lto/20090303_0.C index 88bd6ad9beb..d9ec5a35fed 100644 --- a/gcc/testsuite/g++.dg/lto/20090303_0.C +++ b/gcc/testsuite/g++.dg/lto/20090303_0.C @@ -16,6 +16,8 @@ void Test() { int int_set_; foobar (&int_set_, &test_ints[j]); } + +int main() { Test(); diff --git a/gcc/testsuite/g++.dg/lto/20090311-1_0.C b/gcc/testsuite/g++.dg/lto/20090311-1_0.C index 6d403272428..60c002fbfba 100644 --- a/gcc/testsuite/g++.dg/lto/20090311-1_0.C +++ b/gcc/testsuite/g++.dg/lto/20090311-1_0.C @@ -26,6 +26,8 @@ struct A { A a; extern int foo(); + +int main() { a.x = 4 + c.x; diff --git a/gcc/testsuite/g++.dg/lto/20090312_0.C b/gcc/testsuite/g++.dg/lto/20090312_0.C index b2222c2aa20..579b60e939e 100644 --- a/gcc/testsuite/g++.dg/lto/20090312_0.C +++ b/gcc/testsuite/g++.dg/lto/20090312_0.C @@ -5,6 +5,7 @@ extern "C" { extern JSErrorCallback p; }; +int main() { if ( x == ONE && p == 0) diff --git a/gcc/testsuite/g++.dg/lto/20090315_0.C b/gcc/testsuite/g++.dg/lto/20090315_0.C index 930fb16e5cf..1cae572eeb8 100644 --- a/gcc/testsuite/g++.dg/lto/20090315_0.C +++ b/gcc/testsuite/g++.dg/lto/20090315_0.C @@ -6,4 +6,4 @@ struct Foo { static Foo *foo_; }; Foo *Foo::foo_; -main() { return 0; } +int main() { return 0; } diff --git a/gcc/testsuite/g++.dg/lto/20091002-1_0.C b/gcc/testsuite/g++.dg/lto/20091002-1_0.C index c63b079d77b..a59a0cb9505 100644 --- a/gcc/testsuite/g++.dg/lto/20091002-1_0.C +++ b/gcc/testsuite/g++.dg/lto/20091002-1_0.C @@ -1,6 +1,6 @@ // { dg-lto-do link } // { dg-require-effective-target fpic } -// { dg-lto-options {{-fPIC -flto}} } +// { dg-lto-options {{-fPIC -flto -Wno-return-type}} } // { dg-extra-ld-options "-fPIC -r -nostdlib" } namespace std __attribute__ ((__visibility__ ("default"))) diff --git a/gcc/testsuite/g++.dg/lto/20091002-2_0.C b/gcc/testsuite/g++.dg/lto/20091002-2_0.C index bf936bf53a3..12a1596b3e2 100644 --- a/gcc/testsuite/g++.dg/lto/20091002-2_0.C +++ b/gcc/testsuite/g++.dg/lto/20091002-2_0.C @@ -4,7 +4,7 @@ // { dg-extra-ld-options "-fPIC -r -nostdlib" } class DataArray { - int max() const { } + int max() const { return 0; } }; template < class HashItem > class DataHashTable { diff --git a/gcc/testsuite/g++.dg/lto/20091002-3_0.C b/gcc/testsuite/g++.dg/lto/20091002-3_0.C index 4bff78b4937..0d9afc44c28 100644 --- a/gcc/testsuite/g++.dg/lto/20091002-3_0.C +++ b/gcc/testsuite/g++.dg/lto/20091002-3_0.C @@ -5,7 +5,7 @@ template < class T > class DataArray { - int max() const { } + int max() const { return 0; } }; class Name { }; class DataHashTable { diff --git a/gcc/testsuite/g++.dg/lto/20091004-1_0.C b/gcc/testsuite/g++.dg/lto/20091004-1_0.C index 649e35cb80d..536ae46dadf 100644 --- a/gcc/testsuite/g++.dg/lto/20091004-1_0.C +++ b/gcc/testsuite/g++.dg/lto/20091004-1_0.C @@ -1,6 +1,6 @@ // { dg-lto-do link } // { dg-require-effective-target fpic } -// { dg-lto-options {{-fPIC -O -flto}} } +// { dg-lto-options {{-fPIC -O -flto -Wno-return-type}} } typedef double Real; class Vector { diff --git a/gcc/testsuite/g++.dg/lto/20091004-2_0.C b/gcc/testsuite/g++.dg/lto/20091004-2_0.C index cc1204e6f7e..40ef136514b 100644 --- a/gcc/testsuite/g++.dg/lto/20091004-2_0.C +++ b/gcc/testsuite/g++.dg/lto/20091004-2_0.C @@ -1,6 +1,6 @@ // { dg-lto-do link } // { dg-require-effective-target fpic } -// { dg-lto-options {{-fPIC -O -flto}} } +// { dg-lto-options {{-fPIC -O -flto -Wno-return-type}} } typedef double Real; class Vector { diff --git a/gcc/testsuite/g++.dg/lto/20091004-3_1.C b/gcc/testsuite/g++.dg/lto/20091004-3_1.C index 641c7495b4f..f46b8fc6c11 100644 --- a/gcc/testsuite/g++.dg/lto/20091004-3_1.C +++ b/gcc/testsuite/g++.dg/lto/20091004-3_1.C @@ -12,5 +12,6 @@ All_Torus_Intersections(void) VECTOR D; VLength(len, D); VLength(len, D); + return 0; } diff --git a/gcc/testsuite/g++.dg/lto/20100721-1_0.C b/gcc/testsuite/g++.dg/lto/20100721-1_0.C index 09132e5992b..e39184b76d1 100644 --- a/gcc/testsuite/g++.dg/lto/20100721-1_0.C +++ b/gcc/testsuite/g++.dg/lto/20100721-1_0.C @@ -1,6 +1,6 @@ /* { dg-lto-do assemble } */ -static inline int __gthread_active_p (void) { } +static inline int __gthread_active_p (void) { return 0; } template class Tensor; template struct G; template class T { diff --git a/gcc/testsuite/g++.dg/lto/20101010-1_0.C b/gcc/testsuite/g++.dg/lto/20101010-1_0.C index 6eb40efc868..8f694c78aa7 100644 --- a/gcc/testsuite/g++.dg/lto/20101010-1_0.C +++ b/gcc/testsuite/g++.dg/lto/20101010-1_0.C @@ -1,4 +1,5 @@ // { dg-lto-do link } +// { dg-lto-options "-Wno-return-type" } typedef long size_t; template < class, class > struct pair diff --git a/gcc/testsuite/g++.dg/lto/20101010-2_0.C b/gcc/testsuite/g++.dg/lto/20101010-2_0.C index c68bcd63238..a26956f7fc7 100644 --- a/gcc/testsuite/g++.dg/lto/20101010-2_0.C +++ b/gcc/testsuite/g++.dg/lto/20101010-2_0.C @@ -1,4 +1,5 @@ // { dg-lto-do link } +// { dg-lto-options "-Wno-return-type" } typedef int size_t; template < size_t _Nw > struct _Base_bitset diff --git a/gcc/testsuite/g++.dg/lto/pr45679-1_0.C b/gcc/testsuite/g++.dg/lto/pr45679-1_0.C index 349f5c2c1ef..0dc5fd0dcb5 100644 --- a/gcc/testsuite/g++.dg/lto/pr45679-1_0.C +++ b/gcc/testsuite/g++.dg/lto/pr45679-1_0.C @@ -1,5 +1,5 @@ // { dg-lto-do link } -// { dg-lto-options {{-O3 -Wno-multichar}} } +// { dg-lto-options {{-O3 -Wno-multichar -Wno-return-type }} } // { dg-extra-ld-options "-flto -flto-partition=1to1 -r -nostdlib" } extern "C" { diff --git a/gcc/testsuite/g++.dg/lto/pr45679-1_1.C b/gcc/testsuite/g++.dg/lto/pr45679-1_1.C index c5e2db061fb..9aa92fa540e 100644 --- a/gcc/testsuite/g++.dg/lto/pr45679-1_1.C +++ b/gcc/testsuite/g++.dg/lto/pr45679-1_1.C @@ -1,4 +1,4 @@ - extern "C" { + extern "C" { typedef struct _IO_FILE FILE; extern struct _IO_FILE *stderr; extern int fprintf (FILE *__restrict __stream, __const char *__restrict __format, ...); diff --git a/gcc/testsuite/g++.dg/lto/pr45679-2_0.C b/gcc/testsuite/g++.dg/lto/pr45679-2_0.C index 549741902ba..b88ad92f539 100644 --- a/gcc/testsuite/g++.dg/lto/pr45679-2_0.C +++ b/gcc/testsuite/g++.dg/lto/pr45679-2_0.C @@ -1,6 +1,7 @@ // { dg-lto-do link } -// { dg-lto-options {{-O3 -Wno-multichar}} } +// { dg-lto-options {{-O3 -Wno-multichar -Wno-return-type}} } // { dg-extra-ld-options "-flto -flto-partition=1to1 -r -nostdlib" } + extern "C" { typedef struct { union { diff --git a/gcc/testsuite/g++.dg/lto/pr48042_0.C b/gcc/testsuite/g++.dg/lto/pr48042_0.C index 00b3428e9f1..4ca1a0cebfe 100644 --- a/gcc/testsuite/g++.dg/lto/pr48042_0.C +++ b/gcc/testsuite/g++.dg/lto/pr48042_0.C @@ -10,5 +10,5 @@ class B:public A { }; int B::x() { + return 0; } - diff --git a/gcc/testsuite/g++.dg/lto/pr51650-1_0.C b/gcc/testsuite/g++.dg/lto/pr51650-1_0.C index 4c9ef3c8c48..1c37e629e1d 100644 --- a/gcc/testsuite/g++.dg/lto/pr51650-1_0.C +++ b/gcc/testsuite/g++.dg/lto/pr51650-1_0.C @@ -15,5 +15,6 @@ int fn () { C::m (); + return 0; } -int main() {} +int main() { return 0; } diff --git a/gcc/testsuite/g++.dg/lto/pr51650-3_0.C b/gcc/testsuite/g++.dg/lto/pr51650-3_0.C index e84d555a0fb..ff55e4aab4c 100644 --- a/gcc/testsuite/g++.dg/lto/pr51650-3_0.C +++ b/gcc/testsuite/g++.dg/lto/pr51650-3_0.C @@ -16,5 +16,6 @@ int fn () { C::m (); + return 0; } -int main() {} +int main() { return 0; } diff --git a/gcc/testsuite/g++.dg/lto/pr63270_1.C b/gcc/testsuite/g++.dg/lto/pr63270_1.C index a842e5cfcc6..b5aab3508cf 100644 --- a/gcc/testsuite/g++.dg/lto/pr63270_1.C +++ b/gcc/testsuite/g++.dg/lto/pr63270_1.C @@ -48,6 +48,7 @@ namespace v8 }; int PreParser::ParseMemberWithNewPrefixesExpression ( bool * ) { + return 0; } } } diff --git a/gcc/testsuite/g++.dg/lto/pr65193_0.C b/gcc/testsuite/g++.dg/lto/pr65193_0.C index d778fcabb7f..ceebe51069d 100644 --- a/gcc/testsuite/g++.dg/lto/pr65193_0.C +++ b/gcc/testsuite/g++.dg/lto/pr65193_0.C @@ -1,6 +1,6 @@ /* { dg-lto-do link } */ /* { dg-require-effective-target fpic } */ -/* { dg-lto-options {{-fPIC -r -nostdlib -flto -O2 -g}} } */ +/* { dg-lto-options {{-fPIC -r -nostdlib -flto -O2 -g -Wno-return-type}} } */ void frexp (int, int *); namespace std diff --git a/gcc/testsuite/g++.dg/lto/pr65302_0.C b/gcc/testsuite/g++.dg/lto/pr65302_0.C index 2298afd9d96..83e1194fb10 100644 --- a/gcc/testsuite/g++.dg/lto/pr65302_0.C +++ b/gcc/testsuite/g++.dg/lto/pr65302_0.C @@ -1,5 +1,5 @@ // { dg-lto-do link } -// { dg-lto-options { { -flto -O2 } } } +// { dg-lto-options { { -flto -O2 -Wno-return-type } } } // { dg-extra-ld-options "-r -nostdlib -O0" } class CstringStorageReference { diff --git a/gcc/testsuite/g++.dg/lto/pr65316_0.C b/gcc/testsuite/g++.dg/lto/pr65316_0.C index cccd0db7d8e..2b9360e29fe 100644 --- a/gcc/testsuite/g++.dg/lto/pr65316_0.C +++ b/gcc/testsuite/g++.dg/lto/pr65316_0.C @@ -1,6 +1,7 @@ // { dg-lto-do link } -// { dg-lto-options { { -flto -std=c++11 -g2 -fno-lto-odr-type-merging -O2 } } } +// { dg-lto-options { { -flto -std=c++11 -g2 -fno-lto-odr-type-merging -O2 -Wno-return-type } } } // { dg-extra-ld-options "-r -nostdlib -O2 -fno-lto-odr-type-merging" } + namespace std { typedef long unsigned int size_t; diff --git a/gcc/testsuite/g++.dg/lto/pr65475c_0.C b/gcc/testsuite/g++.dg/lto/pr65475c_0.C index 8e1d8bcc83d..73686918c2c 100644 --- a/gcc/testsuite/g++.dg/lto/pr65475c_0.C +++ b/gcc/testsuite/g++.dg/lto/pr65475c_0.C @@ -1,6 +1,7 @@ /* { dg-lto-do link } */ -/* { dg-lto-options "-O2 -w" } */ /* { dg-extra-ld-options { -O2 -Wno-odr -r -nostdlib } } */ +/* { dg-lto-options { "-O2 -w -Wno-return-type" } } */ + namespace std { template < class > struct char_traits; diff --git a/gcc/testsuite/g++.dg/lto/pr65549_0.C b/gcc/testsuite/g++.dg/lto/pr65549_0.C index 889cc994a58..d3ed1dca158 100644 --- a/gcc/testsuite/g++.dg/lto/pr65549_0.C +++ b/gcc/testsuite/g++.dg/lto/pr65549_0.C @@ -1,5 +1,5 @@ // { dg-lto-do link } -// { dg-lto-options { { -std=gnu++14 -flto -g } { -std=gnu++14 -flto -g -O2 -fno-inline -flto-partition=max } } } +// { dg-lto-options { { -std=gnu++14 -flto -g -Wno-return-type } { -std=gnu++14 -flto -g -O2 -fno-inline -flto-partition=max -Wno-return-type } } } // { dg-extra-ld-options "-r -nostdlib" } namespace std { @@ -135,10 +135,12 @@ public: then(0, [] {}); } } clients; -main() { +int main() { B app; app.run(0, 0, [&] { auto config = app.configuration()[0].as(); clients.then([] {}); }); + + return 0; } diff --git a/gcc/testsuite/g++.dg/lto/pr69077_0.C b/gcc/testsuite/g++.dg/lto/pr69077_0.C index 6a81d0e3a5c..10cb05917b9 100644 --- a/gcc/testsuite/g++.dg/lto/pr69077_0.C +++ b/gcc/testsuite/g++.dg/lto/pr69077_0.C @@ -11,4 +11,4 @@ struct cStdDev struct cWeightedStdDev : public cStdDev { virtual int netPack(); }; -int cWeightedStdDev::netPack() { } +int cWeightedStdDev::netPack() { return 0; } diff --git a/gcc/testsuite/g++.dg/lto/pr69589_0.C b/gcc/testsuite/g++.dg/lto/pr69589_0.C index 599d5d44960..c6f72c4090b 100644 --- a/gcc/testsuite/g++.dg/lto/pr69589_0.C +++ b/gcc/testsuite/g++.dg/lto/pr69589_0.C @@ -1,5 +1,5 @@ // { dg-lto-do link } -// { dg-lto-options "-O2 -rdynamic" } +// { dg-lto-options { "-O2 -rdynamic -Wno-return-type" } } // { dg-extra-ld-options "-r -nostdlib" } // { dg-require-effective-target rdynamic } diff --git a/gcc/testsuite/g++.dg/opt/combine.C b/gcc/testsuite/g++.dg/opt/combine.C index d01ae78a4bc..a1325a0dca9 100644 --- a/gcc/testsuite/g++.dg/opt/combine.C +++ b/gcc/testsuite/g++.dg/opt/combine.C @@ -36,6 +36,7 @@ class QVariant { }; template inline T qvariant_cast (const QVariant &v) { const int vid = qMetaTypeId ((0)) ; + return T(); }; class QScriptContext { @@ -70,4 +71,5 @@ QScriptValue QScriptDebuggerBackendPrivate::trace (QScriptContext *context) { QScriptValue data = context->callee () ; QScriptDebuggerBackendPrivate *self = qscriptvalue_cast (data) ; + return QScriptValue(); } diff --git a/gcc/testsuite/g++.dg/opt/complex3.C b/gcc/testsuite/g++.dg/opt/complex3.C index 9a3fdf3f0d2..ee1b616e403 100644 --- a/gcc/testsuite/g++.dg/opt/complex3.C +++ b/gcc/testsuite/g++.dg/opt/complex3.C @@ -7,7 +7,7 @@ _Complex float g(); _Complex float h()throw(); void i(float)throw(); -float j(void) +void j(void) { _Complex float x = h(); try diff --git a/gcc/testsuite/g++.dg/opt/covariant1.C b/gcc/testsuite/g++.dg/opt/covariant1.C index e57cf4c6be0..b8a93177946 100644 --- a/gcc/testsuite/g++.dg/opt/covariant1.C +++ b/gcc/testsuite/g++.dg/opt/covariant1.C @@ -9,7 +9,7 @@ bar (int x) } struct S { S () {}; virtual ~S () {}; }; -struct T { virtual T *foo (int) {}; }; +struct T { virtual T *foo (int) { return 0; }; }; struct V : virtual S, virtual T {}; struct V v; struct U : public S, public T diff --git a/gcc/testsuite/g++.dg/opt/declone3.C b/gcc/testsuite/g++.dg/opt/declone3.C index 26f3b5214c9..3dd939a961c 100644 --- a/gcc/testsuite/g++.dg/opt/declone3.C +++ b/gcc/testsuite/g++.dg/opt/declone3.C @@ -14,4 +14,4 @@ struct Item : Object, virtual A { } bool m_fn1(); }; -bool Item::m_fn1() {} +bool Item::m_fn1() { return true; } diff --git a/gcc/testsuite/g++.dg/opt/dump1.C b/gcc/testsuite/g++.dg/opt/dump1.C index f74d0247832..f813044456c 100644 --- a/gcc/testsuite/g++.dg/opt/dump1.C +++ b/gcc/testsuite/g++.dg/opt/dump1.C @@ -2,6 +2,7 @@ // { dg-options "-O2 -fno-inline -fdump-final-insns" } // { dg-do compile { target c++11 } } // { dg-final cleanup-final-insns-dump } +// { dg-additional-options "-Wno-return-type" } namespace std { @@ -348,7 +349,7 @@ namespace std __attribute__ ((__visibility__ ("default"))) template inline reference_wrapper<_Tp> ref(_Tp& __t) noexcept - {} + { return reference_wrapper<_Tp>(); } template struct _Maybe_wrap_member_pointer { diff --git a/gcc/testsuite/g++.dg/opt/inline15.C b/gcc/testsuite/g++.dg/opt/inline15.C index 5da3a610519..9aa1b73c863 100644 --- a/gcc/testsuite/g++.dg/opt/inline15.C +++ b/gcc/testsuite/g++.dg/opt/inline15.C @@ -16,7 +16,7 @@ struct A }; struct C : public A { - virtual int bar () { } + virtual int bar () { return 0; } }; struct D : public C { @@ -33,6 +33,7 @@ struct E static unsigned * fn2 () { + return 0; } void diff --git a/gcc/testsuite/g++.dg/opt/local1.C b/gcc/testsuite/g++.dg/opt/local1.C index 9cecaee6f2a..a63afc24f16 100644 --- a/gcc/testsuite/g++.dg/opt/local1.C +++ b/gcc/testsuite/g++.dg/opt/local1.C @@ -8,7 +8,7 @@ struct Outer { inline void h(const Outer &o) { struct Local : public Outer::Inner { - virtual bool f() {}; + virtual bool f() { return true; }; }; Local l; o.g(l); diff --git a/gcc/testsuite/g++.dg/opt/memcpy1.C b/gcc/testsuite/g++.dg/opt/memcpy1.C index e2b1dd2cdf0..66411cdda39 100644 --- a/gcc/testsuite/g++.dg/opt/memcpy1.C +++ b/gcc/testsuite/g++.dg/opt/memcpy1.C @@ -63,6 +63,7 @@ namespace CS // the multiplication below to produce a very large number // in excess of the maximum possible object size (SIZE_MAX/2). __builtin_memcpy (this->OutP, InP, OutV * sizeof (csVector2)); // { dg-warning "specified size \[0-9\]+ exceeds maximum object size" } + return 0; } }; } @@ -79,4 +80,5 @@ csBoxClipper::Clip (csVector2 * InPolygon, size_t InCount, InPolygon, InCount, OutPolygon); uint8 Clipped = boxClip.Clip (); + return 0; } diff --git a/gcc/testsuite/g++.dg/opt/new1.C b/gcc/testsuite/g++.dg/opt/new1.C index dbcc0f8517a..d0f7d95b655 100644 --- a/gcc/testsuite/g++.dg/opt/new1.C +++ b/gcc/testsuite/g++.dg/opt/new1.C @@ -15,8 +15,8 @@ namespace QScript { namespace Ecma { class Core { public: - inline QScriptEnginePrivate *engine() const { } - inline QScriptClassInfo *classInfo() const { } + inline QScriptEnginePrivate *engine() const { return 0; } + inline QScriptClassInfo *classInfo() const { return 0; } QScriptValueImpl publicPrototype; }; class Boolean: public Core { diff --git a/gcc/testsuite/g++.dg/opt/nrv8.C b/gcc/testsuite/g++.dg/opt/nrv8.C index 19999a18824..ca39e7e0f32 100644 --- a/gcc/testsuite/g++.dg/opt/nrv8.C +++ b/gcc/testsuite/g++.dg/opt/nrv8.C @@ -20,7 +20,7 @@ A bar() return l; } -main() +int main() { A a = bar (); diff --git a/gcc/testsuite/g++.dg/opt/pr23299.C b/gcc/testsuite/g++.dg/opt/pr23299.C index b791bf954e8..f14750eb306 100644 --- a/gcc/testsuite/g++.dg/opt/pr23299.C +++ b/gcc/testsuite/g++.dg/opt/pr23299.C @@ -6,15 +6,15 @@ extern "C" void abort (); struct A { - virtual int a () {} + virtual int a () { return 0; } }; struct B : public A { - virtual int b () {} + virtual int b () { return 1; } }; struct C : public A { - virtual int c () {} + virtual int c () { return 2; } }; struct D { diff --git a/gcc/testsuite/g++.dg/opt/pr27826.C b/gcc/testsuite/g++.dg/opt/pr27826.C index 5e40f1746f9..7de08e08133 100644 --- a/gcc/testsuite/g++.dg/opt/pr27826.C +++ b/gcc/testsuite/g++.dg/opt/pr27826.C @@ -5,7 +5,7 @@ struct Geometry { int type:16; }; -struct Geometry get() {}; +struct Geometry get() { return Geometry(); }; int f() { struct Geometry test; diff --git a/gcc/testsuite/g++.dg/opt/pr44919.C b/gcc/testsuite/g++.dg/opt/pr44919.C index a4aeec822bc..1916a2b359d 100644 --- a/gcc/testsuite/g++.dg/opt/pr44919.C +++ b/gcc/testsuite/g++.dg/opt/pr44919.C @@ -1,5 +1,6 @@ // { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } // { dg-options "-O3 -fselective-scheduling2" } +// { dg-additional-options "-Wno-return-type" } namespace std { @@ -9,7 +10,7 @@ template class new_allocator { public: typedef size_t size_type; t template class allocator: public new_allocator<_Tp> { public: typedef size_t size_type; template struct rebind { typedef allocator<_Tp1> other; }; }; class back_insert_iterator { }; -template back_insert_iterator back_inserter(_Container& __x) { }; +template back_insert_iterator back_inserter(_Container& __x) { return back_insert_iterator(); }; class vector { }; @@ -99,6 +100,7 @@ namespace internal { }; template Object intersection( const typename K::Segment_2 &seg, const typename K::Iso_rectangle_2 &iso, const K&) { typedef Segment_2_Iso_rectangle_2_pair is_t; is_t ispair(&seg, &iso); switch (ispair.intersection_type()) { } + return Object(); } template typename Segment_2_Iso_rectangle_2_pair::Intersection_results Segment_2_Iso_rectangle_2_pair::intersection_type() const { typedef typename K::RT RT; diff --git a/gcc/testsuite/g++.dg/opt/pr47615.C b/gcc/testsuite/g++.dg/opt/pr47615.C index f8dbcf7e824..bc467b0c883 100644 --- a/gcc/testsuite/g++.dg/opt/pr47615.C +++ b/gcc/testsuite/g++.dg/opt/pr47615.C @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "-O -fstrict-aliasing -ftree-pre -fno-tree-fre -fno-tree-sra" } +// { dg-additional-options "-Wno-return-type" } typedef __SIZE_TYPE__ size_t; namespace std @@ -434,7 +435,7 @@ template < typename Const_Node_Iterator, typename Node_Iterator, typename, typen return ((m_p_nd->m_p_right)); } bool operator == (bin_search_tree_const_node_it_) - {} + { return true; } node_pointer m_p_nd; }; template @@ -704,7 +705,7 @@ typedef int, null_mapped_type, less < int >, rb_tree_tag, tree_order_statistics_node_update > set_t; -main () +int main () { set_t s; s.insert (12); diff --git a/gcc/testsuite/g++.dg/opt/pr55329.C b/gcc/testsuite/g++.dg/opt/pr55329.C index 3646785d12e..28a8a4d72fa 100644 --- a/gcc/testsuite/g++.dg/opt/pr55329.C +++ b/gcc/testsuite/g++.dg/opt/pr55329.C @@ -19,10 +19,10 @@ struct A int *a; A (); ~A () { a3 (); } - int a1 (int * p) { if (!p) f3 (); f2 (p); } + int a1 (int * p) { if (!p) f3 (); f2 (p); return 0; } int *a2 (); void a3 () { if (*a) a1 (a); } - int a4 (int x) { if (*a) f4 (); *a2 () += x; } + int a4 (int x) { if (*a) f4 (); *a2 () += x; return 0; } }; struct B : A diff --git a/gcc/testsuite/g++.dg/opt/pr61456.C b/gcc/testsuite/g++.dg/opt/pr61456.C index 14a118b5720..51a1e618cb3 100644 --- a/gcc/testsuite/g++.dg/opt/pr61456.C +++ b/gcc/testsuite/g++.dg/opt/pr61456.C @@ -14,6 +14,7 @@ typedef decltype (&Funcs::f1) pfunc; static int Set (Funcs * f, const pfunc & fp) { (f->*fp) (); + return 0; } void diff --git a/gcc/testsuite/g++.dg/opt/pr65003.C b/gcc/testsuite/g++.dg/opt/pr65003.C index 5d131afaedb..333cdbcc477 100644 --- a/gcc/testsuite/g++.dg/opt/pr65003.C +++ b/gcc/testsuite/g++.dg/opt/pr65003.C @@ -26,6 +26,6 @@ struct F : D F (int &, const int &, const A &); bool foo (int &, bool) const; }; -bool D::foo (int &, bool) const {} +bool D::foo (int &, bool) const { return true; } F::F (int &, const int &, const A &) {} -bool F::foo (int &, bool) const {} +bool F::foo (int &, bool) const { return false; } diff --git a/gcc/testsuite/g++.dg/opt/pr65554.C b/gcc/testsuite/g++.dg/opt/pr65554.C index 1519964d1fe..cae2beafe02 100644 --- a/gcc/testsuite/g++.dg/opt/pr65554.C +++ b/gcc/testsuite/g++.dg/opt/pr65554.C @@ -24,6 +24,7 @@ namespace std { int _Num = p2 - p1; __builtin_memmove (0, p1, sizeof (_Tp) * _Num); + return 0; } }; template void __copy_move_a (_II p1, _II p2, _OI p3) @@ -68,6 +69,7 @@ namespace std template static _ForwardIterator __uninit_copy (_InputIterator p1, _InputIterator p2, _ForwardIterator p3) { copy (p1, p2, p3); + return _ForwardIterator(); } }; template void diff --git a/gcc/testsuite/g++.dg/opt/pr69432.C b/gcc/testsuite/g++.dg/opt/pr69432.C index 1f23f2cedd6..d024ece4cba 100644 --- a/gcc/testsuite/g++.dg/opt/pr69432.C +++ b/gcc/testsuite/g++.dg/opt/pr69432.C @@ -26,7 +26,7 @@ void f4 (S, U); struct C { template - static S f5 (S x, T y, U z) { f2 (x, y, z); } + static S f5 (S x, T y, U z) { f2 (x, y, z); return S(); } }; template diff --git a/gcc/testsuite/g++.dg/opt/pr78373.C b/gcc/testsuite/g++.dg/opt/pr78373.C index 9ceef1cc732..b332691ec0b 100644 --- a/gcc/testsuite/g++.dg/opt/pr78373.C +++ b/gcc/testsuite/g++.dg/opt/pr78373.C @@ -12,11 +12,13 @@ struct D : B { static int m_fn3(int, int, int, A) { D &self = singleton; self.m_fn2(); + return 0; } static D singleton; }; template struct C { bool m_fn4() const; }; template bool C::m_fn4() const { Traits::m_fn3(0, 0, 0, Base::singleton); + return true; } template struct C; diff --git a/gcc/testsuite/g++.dg/opt/pr79267.C b/gcc/testsuite/g++.dg/opt/pr79267.C index 177eee6c6f7..69dc6cb0251 100644 --- a/gcc/testsuite/g++.dg/opt/pr79267.C +++ b/gcc/testsuite/g++.dg/opt/pr79267.C @@ -45,12 +45,12 @@ D bar (); template struct L { struct K { K (int); void operator() (int *) { bar ().q (); } }; - static J bp () { bq (0); } + static J bp () { bq (0); return J(); } template static void bq (br) { J (0, K (0)); } }; struct F { - virtual J x (int) { foo (0, 0, 0); J > (L >::bp ()); } + virtual J x (int) { foo (0, 0, 0); J > (L >::bp ()); return J(); } }; void diff --git a/gcc/testsuite/g++.dg/opt/pr82159-2.C b/gcc/testsuite/g++.dg/opt/pr82159-2.C index f153c29ddac..c9797105562 100644 --- a/gcc/testsuite/g++.dg/opt/pr82159-2.C +++ b/gcc/testsuite/g++.dg/opt/pr82159-2.C @@ -1,6 +1,7 @@ // PR c++/82159 // { dg-do compile } // { dg-options "" } +// { dg-additional-options "-Wno-return-type" } template struct D { T e; }; struct F : D { diff --git a/gcc/testsuite/g++.dg/other/array3.C b/gcc/testsuite/g++.dg/other/array3.C index ce3641e8ccd..3e6f7d1ad07 100644 --- a/gcc/testsuite/g++.dg/other/array3.C +++ b/gcc/testsuite/g++.dg/other/array3.C @@ -10,5 +10,6 @@ extern unsigned char xvalue_store[]; bool reserve (int want) { new unsigned char[want]; + return true; } unsigned char xvalue_store[257]; diff --git a/gcc/testsuite/g++.dg/other/crash-5.C b/gcc/testsuite/g++.dg/other/crash-5.C index 25a70b7df36..81e5bac8a25 100644 --- a/gcc/testsuite/g++.dg/other/crash-5.C +++ b/gcc/testsuite/g++.dg/other/crash-5.C @@ -9,7 +9,7 @@ struct int_less_than {}; void assert_fail (const char*); -int f(const set&) +void f(const set&) { assert_fail (__PRETTY_FUNCTION__); diff --git a/gcc/testsuite/g++.dg/other/crash-8.C b/gcc/testsuite/g++.dg/other/crash-8.C index dcae7da76c7..b7f56fc9bd7 100644 --- a/gcc/testsuite/g++.dg/other/crash-8.C +++ b/gcc/testsuite/g++.dg/other/crash-8.C @@ -97,6 +97,8 @@ public: mapped_type& operator[](const key_type& __k) { insert(value_type(__k, mapped_type())); + static mapped_type a; + return a; } }; diff --git a/gcc/testsuite/g++.dg/other/error34.C b/gcc/testsuite/g++.dg/other/error34.C index f5ced1adfdc..f6b44888f48 100644 --- a/gcc/testsuite/g++.dg/other/error34.C +++ b/gcc/testsuite/g++.dg/other/error34.C @@ -2,5 +2,5 @@ // { dg-do compile } // { dg-options "" } -S () : str(__PRETTY_FUNCTION__) {} // { dg-error "forbids declaration" "decl" } +S () : str(__PRETTY_FUNCTION__) { return S(); } // { dg-error "forbids declaration" "decl" } // { dg-error "only constructors" "constructor" { target *-*-* } .-1 } diff --git a/gcc/testsuite/g++.dg/other/pr22003.C b/gcc/testsuite/g++.dg/other/pr22003.C index 222ccac7beb..521e3f9b305 100644 --- a/gcc/testsuite/g++.dg/other/pr22003.C +++ b/gcc/testsuite/g++.dg/other/pr22003.C @@ -21,5 +21,6 @@ struct c3 : c1, c2 c4* c3::func() { + return 0; } diff --git a/gcc/testsuite/g++.dg/other/pr24623.C b/gcc/testsuite/g++.dg/other/pr24623.C index 480bb39b63a..2a337756c2a 100644 --- a/gcc/testsuite/g++.dg/other/pr24623.C +++ b/gcc/testsuite/g++.dg/other/pr24623.C @@ -34,6 +34,8 @@ RefCountPointer (T * p = 0):_p (p) if (_p != 0) _p->decrementRefCount (); } + static RefCountPointer a; + return a; } ~RefCountPointer () { diff --git a/gcc/testsuite/g++.dg/other/pr29610.C b/gcc/testsuite/g++.dg/other/pr29610.C index 6566fb9a204..d68f4a15a07 100644 --- a/gcc/testsuite/g++.dg/other/pr29610.C +++ b/gcc/testsuite/g++.dg/other/pr29610.C @@ -6,7 +6,7 @@ struct __normal_iterator typedef int*const *_Iterator; int*const * _M_current; __normal_iterator(const _Iterator& __i) : _M_current(__i){} - const _Iterator& base() const {} + const _Iterator& base() const { static _Iterator a; return a; } }; struct string { ~string(){} }; struct vector @@ -26,9 +26,10 @@ inline int Painter::for_each(vector &layout, SliceWindowFunc func) { for (unsigned int window = 0; window < layout.size();++window) (this->*func)(); + return 0; } int t; -int Painter::redraw_window(void) {t = 1;} +int Painter::redraw_window(void) {t = 1; return 0; } string t2(int); vector *g(const string&); void Painter::tcl_command(void) diff --git a/gcc/testsuite/g++.dg/other/pr42645-1.C b/gcc/testsuite/g++.dg/other/pr42645-1.C index 5dc76f9efd9..df93645721e 100644 --- a/gcc/testsuite/g++.dg/other/pr42645-1.C +++ b/gcc/testsuite/g++.dg/other/pr42645-1.C @@ -13,7 +13,7 @@ struct S T *t3; } t; int m1 () const { return t.t3[0].t1; } - char *m2 () { foo (); } + char *m2 () { foo (); return 0; } void m3 (int x) { char *m = m2 (); if (m1 () > 0 && x > 0); } void m4 () { if (m1 () > 0) for (int i = 0; i < 4; i++) t.t2[i] = 0; } }; diff --git a/gcc/testsuite/g++.dg/other/pr42645-2.C b/gcc/testsuite/g++.dg/other/pr42645-2.C index 67632e51d91..20cce80f217 100644 --- a/gcc/testsuite/g++.dg/other/pr42645-2.C +++ b/gcc/testsuite/g++.dg/other/pr42645-2.C @@ -8,7 +8,7 @@ struct C C (); }; -static inline C *foo () {} +static inline C *foo () { return 0; } extern void f4 (); @@ -16,6 +16,7 @@ static inline int f3 () { f4 (); + return 0; } static inline void diff --git a/gcc/testsuite/g++.dg/other/pr52048.C b/gcc/testsuite/g++.dg/other/pr52048.C index 6bf51f1e288..cf388a5a045 100644 --- a/gcc/testsuite/g++.dg/other/pr52048.C +++ b/gcc/testsuite/g++.dg/other/pr52048.C @@ -1,6 +1,7 @@ // PR debug/52048 // { dg-do compile } // { dg-options "-fcompare-debug -fnon-call-exceptions -fno-tree-dominator-opts -O2" } +// { dg-additional-options "-Wno-return-type" } template struct A; template diff --git a/gcc/testsuite/g++.dg/other/typedef3.C b/gcc/testsuite/g++.dg/other/typedef3.C index 8ead5b84520..ed9aca2cf53 100644 --- a/gcc/testsuite/g++.dg/other/typedef3.C +++ b/gcc/testsuite/g++.dg/other/typedef3.C @@ -8,5 +8,5 @@ struct XalanCProcessor ParseOptionType getParseOption(void); }; typedef XalanCProcessor::ParseOptionType ParseOptionType; -ParseOptionType XalanCProcessor::getParseOption(void) {} +ParseOptionType XalanCProcessor::getParseOption(void) { return ParseOptionType(); } diff --git a/gcc/testsuite/g++.dg/overload/defarg4.C b/gcc/testsuite/g++.dg/overload/defarg4.C index 3fa0751b7c0..65ad5821aa3 100644 --- a/gcc/testsuite/g++.dg/overload/defarg4.C +++ b/gcc/testsuite/g++.dg/overload/defarg4.C @@ -6,11 +6,11 @@ class foo { template static bool func(const U& x) - {} + { return true; } public: template unsigned int Find(const U& x, bool (*pFunc) (const U&) = func) const - {} + { return 0; } }; class bar { @@ -22,5 +22,6 @@ protected: bool bar::Initialize() { b.Find(b); + return false; } diff --git a/gcc/testsuite/g++.dg/overload/operator5.C b/gcc/testsuite/g++.dg/overload/operator5.C index 329775aa872..b90b0fd912e 100644 --- a/gcc/testsuite/g++.dg/overload/operator5.C +++ b/gcc/testsuite/g++.dg/overload/operator5.C @@ -8,7 +8,7 @@ class String { operator UnspecifiedBoolTypeA() const; operator UnspecifiedBoolTypeB() const; }; -inline bool equalIgnoringCase(const String& a, const String& b) { } +inline bool equalIgnoringCase(const String& a, const String& b) { return true; } inline bool equalPossiblyIgnoringCase(const String& a, const String& b, bool ignoreCase) { diff --git a/gcc/testsuite/g++.dg/overload/ref-conv1.C b/gcc/testsuite/g++.dg/overload/ref-conv1.C index 7e141141264..1c525fbc782 100644 --- a/gcc/testsuite/g++.dg/overload/ref-conv1.C +++ b/gcc/testsuite/g++.dg/overload/ref-conv1.C @@ -1,4 +1,5 @@ // PR c++/50442 +// { dg-additional-options "-Wno-return-type" } template struct MoveRef { operator T& () {} }; template MoveRef Move(T&) {} diff --git a/gcc/testsuite/g++.dg/overload/template5.C b/gcc/testsuite/g++.dg/overload/template5.C index 8ff1b3d657c..902684059a8 100644 --- a/gcc/testsuite/g++.dg/overload/template5.C +++ b/gcc/testsuite/g++.dg/overload/template5.C @@ -6,7 +6,7 @@ int low(T a, T b, T c) { return a + b + c; } // { dg-message "template" } template int high(T a, T b, T c) { return a + b + c; } // { dg-message "template" } -int test (void) +void test (void) { low (5, 6); // { dg-error "no matching function" } // { dg-message "(candidate|3 arguments, 2 provided)" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/g++.dg/parse/crash40.C b/gcc/testsuite/g++.dg/parse/crash40.C index 537cdb78ef1..67322f3eb11 100644 --- a/gcc/testsuite/g++.dg/parse/crash40.C +++ b/gcc/testsuite/g++.dg/parse/crash40.C @@ -15,12 +15,12 @@ class AA struct BB : AA {}; class AAA { - int get() const {} + int get() const { return 0; } }; struct BBB { static BBB *foo(); private: - int get() const {} /* { dg-message "private" } */ + int get() const { return 1; } /* { dg-message "private" } */ }; template struct S { S(unsigned int = BBB::foo()->AAA::get()); /* { dg-error "is not a base of" } */ diff --git a/gcc/testsuite/g++.dg/parse/crash61.C b/gcc/testsuite/g++.dg/parse/crash61.C index 790df0e4bc4..b2004b85173 100644 --- a/gcc/testsuite/g++.dg/parse/crash61.C +++ b/gcc/testsuite/g++.dg/parse/crash61.C @@ -1,5 +1,6 @@ // PR c++/56241 // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } struct pair { constexpr pair (const) : }; // { dg-error "" } template <0> make_pair () {} // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/parse/crash67.C b/gcc/testsuite/g++.dg/parse/crash67.C index 51773ccef53..0befc9e2457 100644 --- a/gcc/testsuite/g++.dg/parse/crash67.C +++ b/gcc/testsuite/g++.dg/parse/crash67.C @@ -1,4 +1,5 @@ // PR c++/79414 +// { dg-additional-options "-Wno-return-type" } class x0; template x2() { // { dg-error "declared|type" } diff --git a/gcc/testsuite/g++.dg/parse/ctor5.C b/gcc/testsuite/g++.dg/parse/ctor5.C index f980b4a184f..917bfb06c34 100644 --- a/gcc/testsuite/g++.dg/parse/ctor5.C +++ b/gcc/testsuite/g++.dg/parse/ctor5.C @@ -1,4 +1,5 @@ // PR c++/27309 +// { dg-additional-options "-Wno-return-type" } struct A { diff --git a/gcc/testsuite/g++.dg/parse/defarg4.C b/gcc/testsuite/g++.dg/parse/defarg4.C index bafdadb9429..151f6c5f668 100644 --- a/gcc/testsuite/g++.dg/parse/defarg4.C +++ b/gcc/testsuite/g++.dg/parse/defarg4.C @@ -19,6 +19,7 @@ struct R int Foo () { R s (1); + return 0; } template struct Q @@ -29,4 +30,5 @@ template struct Q int Foo (Q *s) { s->Foo (1); + return 1; } diff --git a/gcc/testsuite/g++.dg/parse/defarg6.C b/gcc/testsuite/g++.dg/parse/defarg6.C index 827b605b77e..f73c2746cec 100644 --- a/gcc/testsuite/g++.dg/parse/defarg6.C +++ b/gcc/testsuite/g++.dg/parse/defarg6.C @@ -6,6 +6,6 @@ namespace sc_dt { class sc_length_param { - friend int compare_unsigned(int if_v_signed = 0) {} + friend int compare_unsigned(int if_v_signed = 0) { return 0; } }; } diff --git a/gcc/testsuite/g++.dg/parse/error5.C b/gcc/testsuite/g++.dg/parse/error5.C index d14a47664b8..576ae9fd09b 100644 --- a/gcc/testsuite/g++.dg/parse/error5.C +++ b/gcc/testsuite/g++.dg/parse/error5.C @@ -1,19 +1,19 @@ // PR c++/13269 // { dg-options "-fshow-column" } +// { dg-additional-options "-Wno-return-type" } class Foo { int foo() return 0; } }; -// { dg-error "30:expected identifier before numeric constant" "identifier" { target *-*-* } 4 } +// { dg-error "30:expected identifier before numeric constant" "identifier" { target *-*-* } 5 } -// { dg-error "23:named return values are no longer supported" "named return" { target *-*-* } 4 } +// { dg-error "23:named return values are no longer supported" "named return" { target *-*-* } 5 } // the column number info of this error output is still wrong because the error // message has been generated by cp_parser_error() which does not // necessarily allow accurate column number display. At some point, we will // need make cp_parser_error() report more accurate column numbers. -// { dg-error "30:expected '\{' at end of input" "brace" { target *-*-* } 4 } +// { dg-error "30:expected '\{' at end of input" "brace" { target *-*-* } 5 } -// { dg-error "34:expected ';' after class definition" "semicolon" {target *-*-* } 4 } - -// { dg-error "35:expected declaration before '\}' token" "declaration" {target *-*-* } 4 } +// { dg-error "34:expected ';' after class definition" "semicolon" {target *-*-* } 5 } +// { dg-error "35:expected declaration before '\}' token" "declaration" {target *-*-* } 5 } diff --git a/gcc/testsuite/g++.dg/parse/expr2.C b/gcc/testsuite/g++.dg/parse/expr2.C index 32800e4f9cd..fb572e9408a 100644 --- a/gcc/testsuite/g++.dg/parse/expr2.C +++ b/gcc/testsuite/g++.dg/parse/expr2.C @@ -2,7 +2,7 @@ struct X { X(double *data, double d0, double d1); }; -int foo(double d0) { +void foo(double d0) { double * data; X(data,d0,d0); } diff --git a/gcc/testsuite/g++.dg/parse/friend7.C b/gcc/testsuite/g++.dg/parse/friend7.C index 72ab430ef1b..7fc480f3ea0 100644 --- a/gcc/testsuite/g++.dg/parse/friend7.C +++ b/gcc/testsuite/g++.dg/parse/friend7.C @@ -1,5 +1,6 @@ // PR c++/34488 // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } struct A { diff --git a/gcc/testsuite/g++.dg/parse/namespace1.C b/gcc/testsuite/g++.dg/parse/namespace1.C index 7740bce2dc4..56697419253 100644 --- a/gcc/testsuite/g++.dg/parse/namespace1.C +++ b/gcc/testsuite/g++.dg/parse/namespace1.C @@ -2,6 +2,6 @@ namespace foo { void baz(int); } -int bar(int foo) { +void bar(int foo) { foo::baz (3); } diff --git a/gcc/testsuite/g++.dg/parse/namespace9.C b/gcc/testsuite/g++.dg/parse/namespace9.C index 7ff0267bff3..d5da5446a65 100644 --- a/gcc/testsuite/g++.dg/parse/namespace9.C +++ b/gcc/testsuite/g++.dg/parse/namespace9.C @@ -1,7 +1,7 @@ namespace A { void f(); } -int g() +void g() { struct f { }; using A::f; diff --git a/gcc/testsuite/g++.dg/parse/ret-type2.C b/gcc/testsuite/g++.dg/parse/ret-type2.C index 4b7a0457edd..913c8fe0002 100644 --- a/gcc/testsuite/g++.dg/parse/ret-type2.C +++ b/gcc/testsuite/g++.dg/parse/ret-type2.C @@ -1,3 +1,5 @@ +// { dg-additional-options "-Wno-return-type" } + struct S {} f(); // { dg-error "return" "err" } // { dg-message "note" "note" { target *-*-* } .-1 } struct T {} *g(); // { dg-error "return" } diff --git a/gcc/testsuite/g++.dg/parse/typedef8.C b/gcc/testsuite/g++.dg/parse/typedef8.C index 4c1823e87b9..60b8f39ee5e 100644 --- a/gcc/testsuite/g++.dg/parse/typedef8.C +++ b/gcc/testsuite/g++.dg/parse/typedef8.C @@ -5,7 +5,7 @@ typedef register int b; // { dg-error "conflicting" } typedef extern int c; // { dg-error "conflicting" } static typedef int a; // { dg-error "conflicting" } -int foo() +void foo() { typedef auto int bar; // { dg-error "conflicting|two or more data types" } } diff --git a/gcc/testsuite/g++.dg/pch/static-1.C b/gcc/testsuite/g++.dg/pch/static-1.C index 21e77898298..cd6d4111cc5 100644 --- a/gcc/testsuite/g++.dg/pch/static-1.C +++ b/gcc/testsuite/g++.dg/pch/static-1.C @@ -2,9 +2,11 @@ int LocalStaticTest() { static A sa; + return 0; } int main(int argc, char **argv) { A::StaticTest(); + return 0; } diff --git a/gcc/testsuite/g++.dg/plugin/diagnostic-test-expressions-1.C b/gcc/testsuite/g++.dg/plugin/diagnostic-test-expressions-1.C index a145dfea28c..8b6afeb052a 100644 --- a/gcc/testsuite/g++.dg/plugin/diagnostic-test-expressions-1.C +++ b/gcc/testsuite/g++.dg/plugin/diagnostic-test-expressions-1.C @@ -66,7 +66,7 @@ struct test_struct int field; }; -int test_structure_references (struct test_struct *ptr) +void test_structure_references (struct test_struct *ptr) { struct test_struct local; local.field = 42; @@ -84,7 +84,7 @@ int test_structure_references (struct test_struct *ptr) { dg-end-multiline-output "" } */ } -int test_postfix_incdec (int i) +void test_postfix_incdec (int i) { __emit_expression_range (0, i++ ); /* { dg-warning "range" } */ /* { dg-begin-multiline-output "" } @@ -101,7 +101,7 @@ int test_postfix_incdec (int i) /* Unary operators. ****************************************************/ -int test_sizeof (int i) +void test_sizeof (int i) { __emit_expression_range (0, sizeof(int) + i); /* { dg-warning "range" } */ /* { dg-begin-multiline-output "" } @@ -128,7 +128,7 @@ int test_sizeof (int i) { dg-end-multiline-output "" } */ } -int test_alignof (int i) +void test_alignof (int i) { __emit_expression_range (0, alignof(int) + i); /* { dg-warning "range" } */ /* { dg-begin-multiline-output "" } @@ -167,7 +167,7 @@ int test_alignof (int i) { dg-end-multiline-output "" } */ } -int test_prefix_incdec (int i) +void test_prefix_incdec (int i) { __emit_expression_range (0, ++i ); /* { dg-warning "range" } */ /* { dg-begin-multiline-output "" } diff --git a/gcc/testsuite/g++.dg/plugin/dumb-plugin-test-1.C b/gcc/testsuite/g++.dg/plugin/dumb-plugin-test-1.C index 70101c86826..404cd2124c0 100644 --- a/gcc/testsuite/g++.dg/plugin/dumb-plugin-test-1.C +++ b/gcc/testsuite/g++.dg/plugin/dumb-plugin-test-1.C @@ -26,7 +26,7 @@ struct Bar { int g = g; Foo foo = foo; -int func() +void func() { Bar *bar1, bar2; Foo local_foo; diff --git a/gcc/testsuite/g++.dg/plugin/self-assign-test-1.C b/gcc/testsuite/g++.dg/plugin/self-assign-test-1.C index 95d39dd0ce6..08bee09f0d5 100644 --- a/gcc/testsuite/g++.dg/plugin/self-assign-test-1.C +++ b/gcc/testsuite/g++.dg/plugin/self-assign-test-1.C @@ -26,7 +26,7 @@ struct Bar { int g = g; // { dg-warning "assigned to itself" } Foo foo = foo; // { dg-warning "assigned to itself" } -int func() +void func() { Bar *bar1, bar2; Foo local_foo; diff --git a/gcc/testsuite/g++.dg/plugin/self-assign-test-2.C b/gcc/testsuite/g++.dg/plugin/self-assign-test-2.C index da963c42db2..2c9d8cb7d0e 100644 --- a/gcc/testsuite/g++.dg/plugin/self-assign-test-2.C +++ b/gcc/testsuite/g++.dg/plugin/self-assign-test-2.C @@ -26,7 +26,7 @@ struct Bar { int g = g; // { dg-warning "assigned to itself" } Foo foo = foo; // { dg-warning "assigned to itself" } -int func() +void func() { Bar *bar1, bar2; Foo local_foo; diff --git a/gcc/testsuite/g++.dg/plugin/self-assign-test-3.C b/gcc/testsuite/g++.dg/plugin/self-assign-test-3.C index e5b354baff2..48a1aa4139c 100644 --- a/gcc/testsuite/g++.dg/plugin/self-assign-test-3.C +++ b/gcc/testsuite/g++.dg/plugin/self-assign-test-3.C @@ -26,7 +26,7 @@ struct Bar { int g = g; // { dg-bogus "assigned to itself" } Foo foo = foo; // { dg-bogus "assigned to itself" } -int func() +void func() { Bar *bar1, bar2; Foo local_foo; diff --git a/gcc/testsuite/g++.dg/pr55513.C b/gcc/testsuite/g++.dg/pr55513.C index 35c728d30a3..1c119e40ebd 100644 --- a/gcc/testsuite/g++.dg/pr55513.C +++ b/gcc/testsuite/g++.dg/pr55513.C @@ -1,11 +1,13 @@ // { dg-do compile } // { dg-options "-O0 -fdump-tree-gimple" } +int main () { char s[10]; const int t = (__builtin_memcpy (s, "Hello", 6), 777); __builtin_printf ("%d %s\n", t, s); + return 0; } // { dg-final { scan-tree-dump-times "memcpy" 1 "gimple" } } diff --git a/gcc/testsuite/g++.dg/pr55604.C b/gcc/testsuite/g++.dg/pr55604.C index f6fa3c0f42c..f67a1b4ef14 100644 --- a/gcc/testsuite/g++.dg/pr55604.C +++ b/gcc/testsuite/g++.dg/pr55604.C @@ -1,10 +1,12 @@ /* { dg-do compile } */ /* { dg-options "-O -fdump-rtl-reload" } */ +int main () { char s[10]; const int t = (__builtin_memcpy (s, "Hello", 6), 5); __builtin_printf ("%d %s\n", t, s); + return 0; } diff --git a/gcc/testsuite/g++.dg/pr57662.C b/gcc/testsuite/g++.dg/pr57662.C index bd5793dcaea..1592433d0d7 100644 --- a/gcc/testsuite/g++.dg/pr57662.C +++ b/gcc/testsuite/g++.dg/pr57662.C @@ -1,5 +1,6 @@ /* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */ /* { dg-options "-O2 -fselective-scheduling2 -fsel-sched-pipelining" } */ +/* { dg-additional-options "-Wno-return-type" } */ extern "C" { typedef struct _IO_FILE FILE; diff --git a/gcc/testsuite/g++.dg/pr58389.C b/gcc/testsuite/g++.dg/pr58389.C index 648c145459b..8c98b67076b 100644 --- a/gcc/testsuite/g++.dg/pr58389.C +++ b/gcc/testsuite/g++.dg/pr58389.C @@ -51,4 +51,4 @@ inline void C::m_fn1() { sort(c, b, qt_notclosestLeaf); } } -A F::m_fn1() const { const_cast(this)->d_ptr->m_fn1(); } +A F::m_fn1() const { const_cast(this)->d_ptr->m_fn1(); return A(); } diff --git a/gcc/testsuite/g++.dg/pr59510.C b/gcc/testsuite/g++.dg/pr59510.C index dcdf860dcf7..4ac5becfd26 100644 --- a/gcc/testsuite/g++.dg/pr59510.C +++ b/gcc/testsuite/g++.dg/pr59510.C @@ -1,6 +1,7 @@ // PR debug/59510 // { dg-do compile } // { dg-options "-O2 -g --param=large-stack-frame-growth=1" } +// { dg-additional-options "-Wno-return-type" } template struct _Iter_base diff --git a/gcc/testsuite/g++.dg/pr67989.C b/gcc/testsuite/g++.dg/pr67989.C index c3023557d31..26748997fdd 100644 --- a/gcc/testsuite/g++.dg/pr67989.C +++ b/gcc/testsuite/g++.dg/pr67989.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-std=c++11 -O2" } */ +/* { dg-additional-options "-Wno-return-type" } */ __extension__ typedef unsigned long long int uint64_t; namespace std __attribute__ ((__visibility__ ("default"))) diff --git a/gcc/testsuite/g++.dg/pr70590-2.C b/gcc/testsuite/g++.dg/pr70590-2.C index 409c86eccd1..fd79dbfc883 100644 --- a/gcc/testsuite/g++.dg/pr70590-2.C +++ b/gcc/testsuite/g++.dg/pr70590-2.C @@ -8,13 +8,13 @@ constexpr int *foo = &a; void blah (int *); -int +void bar () { blah (foo); } -int +void baz () { blah (foo); diff --git a/gcc/testsuite/g++.dg/pr70590.C b/gcc/testsuite/g++.dg/pr70590.C index 488620065ee..28c455ab530 100644 --- a/gcc/testsuite/g++.dg/pr70590.C +++ b/gcc/testsuite/g++.dg/pr70590.C @@ -12,13 +12,13 @@ foo () void blah (int *); -int +void bar () { blah (foo ()); } -int +void baz () { blah (foo ()); diff --git a/gcc/testsuite/g++.dg/pr70965.C b/gcc/testsuite/g++.dg/pr70965.C index d8a2c35e532..4b45789845f 100644 --- a/gcc/testsuite/g++.dg/pr70965.C +++ b/gcc/testsuite/g++.dg/pr70965.C @@ -14,7 +14,7 @@ template struct D extern template class D; enum L { M }; struct F { virtual char *foo (); }; -template struct I : B { static int foo (int) {} }; +template struct I : B { static int foo (int) { return 0; } }; struct G { typedef I t; }; void foo (int) { G::t::foo (0); } void bar (const D &, const D &, int, L); diff --git a/gcc/testsuite/g++.dg/pr77550.C b/gcc/testsuite/g++.dg/pr77550.C index a1064737a67..9b31defd09c 100644 --- a/gcc/testsuite/g++.dg/pr77550.C +++ b/gcc/testsuite/g++.dg/pr77550.C @@ -235,7 +235,7 @@ template struct basic_string { basic_string() : _M_dataplus(0) {} basic_string(const basic_string &) : _M_dataplus(0) {} size_type size() { return _M_string_length; } - char *data() const {} + char *data() const { return 0; } }; //template<> basic_string, std::allocator>:: //_Alloc_hider::_Alloc_hider(char*, std::allocator&&) {} diff --git a/gcc/testsuite/g++.dg/pr80287.C b/gcc/testsuite/g++.dg/pr80287.C index da8d3fab150..d01e73371de 100644 --- a/gcc/testsuite/g++.dg/pr80287.C +++ b/gcc/testsuite/g++.dg/pr80287.C @@ -3,7 +3,7 @@ // { dg-options "-g" } struct A { - operator long() {} + operator long() { return 0; } } __attribute__((__may_alias__)); struct { diff --git a/gcc/testsuite/g++.dg/pr80707.C b/gcc/testsuite/g++.dg/pr80707.C index 4fe89335e31..b3848b0eb5f 100644 --- a/gcc/testsuite/g++.dg/pr80707.C +++ b/gcc/testsuite/g++.dg/pr80707.C @@ -26,4 +26,6 @@ int A::m_fn1(int &p1) const { p1 = 0; b--; } + + return 0; } diff --git a/gcc/testsuite/g++.dg/pr81194.C b/gcc/testsuite/g++.dg/pr81194.C index 249fcf3b7c7..5f949389ec6 100644 --- a/gcc/testsuite/g++.dg/pr81194.C +++ b/gcc/testsuite/g++.dg/pr81194.C @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "-O2 -std=c++17 -fno-exceptions" } +// { dg-additional-options "-Wno-return-type" } template struct b { typedef a *c; }; class e {}; diff --git a/gcc/testsuite/g++.dg/spellcheck-identifiers.C b/gcc/testsuite/g++.dg/spellcheck-identifiers.C index 08434399e6f..e4a606e2052 100644 --- a/gcc/testsuite/g++.dg/spellcheck-identifiers.C +++ b/gcc/testsuite/g++.dg/spellcheck-identifiers.C @@ -136,7 +136,7 @@ enum foo { FOO_SECOND }; -int +void test_6 (enum foo f) { switch (f) diff --git a/gcc/testsuite/g++.dg/tc1/dr152.C b/gcc/testsuite/g++.dg/tc1/dr152.C index e787f8bcbfb..7d84d6afc1a 100644 --- a/gcc/testsuite/g++.dg/tc1/dr152.C +++ b/gcc/testsuite/g++.dg/tc1/dr152.C @@ -12,6 +12,7 @@ namespace N1 { { X x; f(x); // { dg-error "matching" "matching" } + return 0; } } @@ -30,6 +31,7 @@ namespace N2 { { X x; N2::f(x); // { dg-error "matching" "matching" } + return 0; } template int foo(); // { dg-message "required from here" } diff --git a/gcc/testsuite/g++.dg/template/aggr-init1.C b/gcc/testsuite/g++.dg/template/aggr-init1.C index a09c7a79264..a7fe7c0441b 100644 --- a/gcc/testsuite/g++.dg/template/aggr-init1.C +++ b/gcc/testsuite/g++.dg/template/aggr-init1.C @@ -4,5 +4,5 @@ struct A {}; struct B { void *(*a)(); }; -template void *CreateA() {} +template void *CreateA() { return 0; } B b = {CreateA}; diff --git a/gcc/testsuite/g++.dg/template/anon1.C b/gcc/testsuite/g++.dg/template/anon1.C index ef73df6b39e..ff5c9ea1553 100644 --- a/gcc/testsuite/g++.dg/template/anon1.C +++ b/gcc/testsuite/g++.dg/template/anon1.C @@ -1,10 +1,10 @@ struct x { - int foo () {} + int foo () { return 0; } }; template struct vector { - T& bar () {} + T& bar () { static T a; return a; } }; template diff --git a/gcc/testsuite/g++.dg/template/array29.C b/gcc/testsuite/g++.dg/template/array29.C index e43cb9d965a..f3eb95dc0aa 100644 --- a/gcc/testsuite/g++.dg/template/array29.C +++ b/gcc/testsuite/g++.dg/template/array29.C @@ -30,6 +30,7 @@ template struct D typename BaseT::callback_type p3) { p3.on_extended_iso_date (); + return char_type(); } }; struct F diff --git a/gcc/testsuite/g++.dg/template/array7.C b/gcc/testsuite/g++.dg/template/array7.C index 1fb130f9961..59364be33cf 100644 --- a/gcc/testsuite/g++.dg/template/array7.C +++ b/gcc/testsuite/g++.dg/template/array7.C @@ -6,6 +6,7 @@ template int bar( const char(&val)[M] ) { foo (N,M); + return 0; } int i = bar<10>("1234"); diff --git a/gcc/testsuite/g++.dg/template/canon-type-8.C b/gcc/testsuite/g++.dg/template/canon-type-8.C index fd1fe3ce362..b72bd0fb770 100644 --- a/gcc/testsuite/g++.dg/template/canon-type-8.C +++ b/gcc/testsuite/g++.dg/template/canon-type-8.C @@ -2,6 +2,7 @@ // We were getting different canonical types for matching types because // TYPE_ALIGN wasn't propagated to all the variants fast enough. // { dg-options "" } +// { dg-additional-options "-Wno-return-type" } typedef __SIZE_TYPE__ size_t; enum { chunk_size = 16 }; diff --git a/gcc/testsuite/g++.dg/template/conv1.C b/gcc/testsuite/g++.dg/template/conv1.C index e0c7492034c..80c7becd665 100644 --- a/gcc/testsuite/g++.dg/template/conv1.C +++ b/gcc/testsuite/g++.dg/template/conv1.C @@ -16,8 +16,8 @@ template struct First }; template int First::Foo () -{} // This is here to make sure we didn't smash Foo's decl in the - // method vector +{ return 0; } // This is here to make sure we didn't smash Foo's decl in the + // method vector struct B { }; struct D { }; diff --git a/gcc/testsuite/g++.dg/template/crash107.C b/gcc/testsuite/g++.dg/template/crash107.C index d92ee3394e2..cecf9013244 100644 --- a/gcc/testsuite/g++.dg/template/crash107.C +++ b/gcc/testsuite/g++.dg/template/crash107.C @@ -1,6 +1,7 @@ // PR c++/44625 // { dg-do compile } // { dg-options "" } +// { dg-additional-options "-Wno-return-type" } template struct Vec { // { dg-message "note" } Vec& operator^=(Vec& rhs) { diff --git a/gcc/testsuite/g++.dg/template/crash23.C b/gcc/testsuite/g++.dg/template/crash23.C index 0c3eac1acbf..b8dea99b4b1 100644 --- a/gcc/testsuite/g++.dg/template/crash23.C +++ b/gcc/testsuite/g++.dg/template/crash23.C @@ -1,7 +1,7 @@ // PR c++/17642 template -int f(const int* const lsh, const int* const bbox, const int* const nghostzones, int d) +void f(const int* const lsh, const int* const bbox, const int* const nghostzones, int d) { for (int d=0; d - int wom(U c) + void wom(U c) { struct foo b; } diff --git a/gcc/testsuite/g++.dg/template/defarg4.C b/gcc/testsuite/g++.dg/template/defarg4.C index 293538adbd1..30711c22c0b 100644 --- a/gcc/testsuite/g++.dg/template/defarg4.C +++ b/gcc/testsuite/g++.dg/template/defarg4.C @@ -1,7 +1,7 @@ // PR c++/14763 struct A { - int get() const {} + int get() const { return 0; } static A *foo(); }; diff --git a/gcc/testsuite/g++.dg/template/dependent-expr9.C b/gcc/testsuite/g++.dg/template/dependent-expr9.C index 7da060d4bb6..e5abc2525d3 100644 --- a/gcc/testsuite/g++.dg/template/dependent-expr9.C +++ b/gcc/testsuite/g++.dg/template/dependent-expr9.C @@ -6,5 +6,5 @@ public: }; A *fn1(int *); template class B : A { - static int *m_fn2() { fn1(m_fn2())->m_fn1(); } + static int *m_fn2() { fn1(m_fn2())->m_fn1(); return 0; } }; diff --git a/gcc/testsuite/g++.dg/template/error10.C b/gcc/testsuite/g++.dg/template/error10.C index 02ea64b7912..a61d22f1916 100644 --- a/gcc/testsuite/g++.dg/template/error10.C +++ b/gcc/testsuite/g++.dg/template/error10.C @@ -24,6 +24,7 @@ void B(void) {} int Btest() { B<256 >> 4>(); + return 0; } template >4> diff --git a/gcc/testsuite/g++.dg/template/friend32.C b/gcc/testsuite/g++.dg/template/friend32.C index 94bff37776f..278b4960602 100644 --- a/gcc/testsuite/g++.dg/template/friend32.C +++ b/gcc/testsuite/g++.dg/template/friend32.C @@ -18,4 +18,5 @@ template class B int f () { B b; // { dg-message "required" } + return 0; } diff --git a/gcc/testsuite/g++.dg/template/init6.C b/gcc/testsuite/g++.dg/template/init6.C index 143746642fc..d5467023b5b 100644 --- a/gcc/testsuite/g++.dg/template/init6.C +++ b/gcc/testsuite/g++.dg/template/init6.C @@ -24,8 +24,10 @@ template Iter::Node*> *Graph::Inner::get() { SubIter::Node*> *iter; iter->insert(0); + return 0; } int main() { Iter::Node*> *n2_iter = new SubIter::Node*>(); + return 0; } diff --git a/gcc/testsuite/g++.dg/template/memfriend7.C b/gcc/testsuite/g++.dg/template/memfriend7.C index 2659a1a2191..e6bf12f9654 100644 --- a/gcc/testsuite/g++.dg/template/memfriend7.C +++ b/gcc/testsuite/g++.dg/template/memfriend7.C @@ -49,6 +49,7 @@ template int A::h() { C c; c.ii = 0; // { dg-error "context" } + return 0; } template void A::i(char) @@ -93,6 +94,7 @@ int A::h() { C c; c.ii = 0; // { dg-error "context" } + return 0; } void A::i(char) diff --git a/gcc/testsuite/g++.dg/template/new10.C b/gcc/testsuite/g++.dg/template/new10.C index 98293ba5bd4..1a0c044c005 100644 --- a/gcc/testsuite/g++.dg/template/new10.C +++ b/gcc/testsuite/g++.dg/template/new10.C @@ -20,4 +20,5 @@ bool Analyzer::ReadDictionary( READER &reader ) = ( number_of_composite_sequences + SequenceMapIndex( 1 ) ) * ( number_of_composite_sequences + 1 ); map_from_2_hints_to_composite_sequence.reset(new SequenceIndex[ntt]()); + return true; } diff --git a/gcc/testsuite/g++.dg/template/nontype12.C b/gcc/testsuite/g++.dg/template/nontype12.C index b4bb41d109b..4ec22ef94e3 100644 --- a/gcc/testsuite/g++.dg/template/nontype12.C +++ b/gcc/testsuite/g++.dg/template/nontype12.C @@ -27,7 +27,7 @@ template struct C template int foo(); // { dg-error "double" } }; -template int baz(T) { C c; } // { dg-message "required" } +template int baz(T) { C c; return 0;} // { dg-message "required" } void foobar() { diff --git a/gcc/testsuite/g++.dg/template/overload12.C b/gcc/testsuite/g++.dg/template/overload12.C index 3251474bd6a..43898efebde 100644 --- a/gcc/testsuite/g++.dg/template/overload12.C +++ b/gcc/testsuite/g++.dg/template/overload12.C @@ -8,7 +8,7 @@ int foo(T a, T2& b, T2 c) {return a + b;} // { dg-message "template" } int foo(char*, S&); // { dg-message "foo" } // { dg-message "candidate expects 2 arguments, 3 provided" "arity" { target *-*-* } .-1 } -int foo2(int x) +void foo2(int x) { S s={1,2}; char c; diff --git a/gcc/testsuite/g++.dg/template/overload5.C b/gcc/testsuite/g++.dg/template/overload5.C index 8e520e92907..06075eca78f 100644 --- a/gcc/testsuite/g++.dg/template/overload5.C +++ b/gcc/testsuite/g++.dg/template/overload5.C @@ -24,5 +24,6 @@ int foo::f() f_obj<&foo::g> c; // OK f_obj d; // OK + return 0; } diff --git a/gcc/testsuite/g++.dg/template/overload8.C b/gcc/testsuite/g++.dg/template/overload8.C index cc6a05b7041..4775db18d87 100644 --- a/gcc/testsuite/g++.dg/template/overload8.C +++ b/gcc/testsuite/g++.dg/template/overload8.C @@ -3,5 +3,5 @@ struct A { template void foo() {} - template int foo() {} + template int foo() { return 0; } }; diff --git a/gcc/testsuite/g++.dg/template/partial10.C b/gcc/testsuite/g++.dg/template/partial10.C index 53a48fbac82..673baae2023 100644 --- a/gcc/testsuite/g++.dg/template/partial10.C +++ b/gcc/testsuite/g++.dg/template/partial10.C @@ -10,9 +10,10 @@ template void def(Fn fn) {} template T2 fn(T1, T2); -template int fn(T1) { } +template int fn(T1) { return 0; } int main() { def(fn); + return 0; } diff --git a/gcc/testsuite/g++.dg/template/partial9.C b/gcc/testsuite/g++.dg/template/partial9.C index 4c340fc935d..8307c70883e 100644 --- a/gcc/testsuite/g++.dg/template/partial9.C +++ b/gcc/testsuite/g++.dg/template/partial9.C @@ -1,6 +1,6 @@ // PR c++/36435 template T f(); -template T* f() { } +template T* f() { return 0; } template int* f(); diff --git a/gcc/testsuite/g++.dg/template/qual1.C b/gcc/testsuite/g++.dg/template/qual1.C index 8fa79b3d2e7..7b20265eb9a 100644 --- a/gcc/testsuite/g++.dg/template/qual1.C +++ b/gcc/testsuite/g++.dg/template/qual1.C @@ -7,7 +7,7 @@ public: void sort (int (*compare) (T *const&,T *const&)); }; -int shift_compare (int *const &, int *const &) {} +int shift_compare (int *const &, int *const &) { return 0; } template void Link_array::sort (int (*compare) (T *const&,T *const&)) diff --git a/gcc/testsuite/g++.dg/template/show-template-tree-3.C b/gcc/testsuite/g++.dg/template/show-template-tree-3.C index 0eda40bcf77..7bb93ba4f60 100644 --- a/gcc/testsuite/g++.dg/template/show-template-tree-3.C +++ b/gcc/testsuite/g++.dg/template/show-template-tree-3.C @@ -9,6 +9,7 @@ for that in this case). */ // { dg-options "-fdiagnostics-show-template-tree" } +// { dg-additional-options "-Wno-return-type" } #include #include diff --git a/gcc/testsuite/g++.dg/template/sizeof8.C b/gcc/testsuite/g++.dg/template/sizeof8.C index 861febc161c..bed68f9d16e 100644 --- a/gcc/testsuite/g++.dg/template/sizeof8.C +++ b/gcc/testsuite/g++.dg/template/sizeof8.C @@ -4,6 +4,6 @@ template struct S{}; -template S f() {} +template S f() { return S(); } template S f<2>(); diff --git a/gcc/testsuite/g++.dg/template/sizeof9.C b/gcc/testsuite/g++.dg/template/sizeof9.C index 8d9ec95ae1f..84400d3a364 100644 --- a/gcc/testsuite/g++.dg/template/sizeof9.C +++ b/gcc/testsuite/g++.dg/template/sizeof9.C @@ -2,5 +2,5 @@ template struct X { char x[N]; }; template X<1 + sizeof(T) - sizeof(T)> F(T const &); -template struct S { int d() { F(1); } }; +template struct S { int d() { F(1); return S(); } }; diff --git a/gcc/testsuite/g++.dg/template/spec6.C b/gcc/testsuite/g++.dg/template/spec6.C index 915b8331252..fd41d7417c2 100644 --- a/gcc/testsuite/g++.dg/template/spec6.C +++ b/gcc/testsuite/g++.dg/template/spec6.C @@ -1,3 +1,5 @@ +// { dg-additional-options "-Wno-return-type" } + template struct X {}; template struct X { diff --git a/gcc/testsuite/g++.dg/template/spec7.C b/gcc/testsuite/g++.dg/template/spec7.C index 18d3c90c45e..caf6b91d151 100644 --- a/gcc/testsuite/g++.dg/template/spec7.C +++ b/gcc/testsuite/g++.dg/template/spec7.C @@ -20,7 +20,7 @@ template<> template<> template void A::B::g(V) A::B b; -int h() +void h() { b.f(); b.g(0); diff --git a/gcc/testsuite/g++.dg/template/typedef8.C b/gcc/testsuite/g++.dg/template/typedef8.C index f132606889b..b3178842172 100644 --- a/gcc/testsuite/g++.dg/template/typedef8.C +++ b/gcc/testsuite/g++.dg/template/typedef8.C @@ -1,4 +1,5 @@ // PR c++/34206 +// { dg-additional-options "-Wno-return-type" } template struct pair { }; template struct tuple { diff --git a/gcc/testsuite/g++.dg/template/using20.C b/gcc/testsuite/g++.dg/template/using20.C index 1df9549cd6c..cf180d21fe9 100644 --- a/gcc/testsuite/g++.dg/template/using20.C +++ b/gcc/testsuite/g++.dg/template/using20.C @@ -15,4 +15,5 @@ int f(void) { G a; a.f(); + return 0; } diff --git a/gcc/testsuite/g++.dg/template/vla1.C b/gcc/testsuite/g++.dg/template/vla1.C index fe93440f1f2..d873f2b0b06 100644 --- a/gcc/testsuite/g++.dg/template/vla1.C +++ b/gcc/testsuite/g++.dg/template/vla1.C @@ -5,5 +5,6 @@ template static int label (int w) { sizeof(int[w]); + return 0; } int a = label(1); diff --git a/gcc/testsuite/g++.dg/tm/cgraph_edge.C b/gcc/testsuite/g++.dg/tm/cgraph_edge.C index d4c8f77fe89..b2649e8f521 100644 --- a/gcc/testsuite/g++.dg/tm/cgraph_edge.C +++ b/gcc/testsuite/g++.dg/tm/cgraph_edge.C @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "-fgnu-tm -O3" } +// { dg-additional-options "-Wno-return-type" } template inline void advance(_InputIterator& __i, _Distance __n) { diff --git a/gcc/testsuite/g++.dg/tm/pr46646.C b/gcc/testsuite/g++.dg/tm/pr46646.C index 9431615b0fb..be378b0bd5c 100644 --- a/gcc/testsuite/g++.dg/tm/pr46646.C +++ b/gcc/testsuite/g++.dg/tm/pr46646.C @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "-fgnu-tm -O0"} +// { dg-additional-options "-Wno-return-type" } namespace std __attribute__ ((__visibility__ ("default"))) { template diff --git a/gcc/testsuite/g++.dg/tm/pr47554.C b/gcc/testsuite/g++.dg/tm/pr47554.C index 28841bb15ad..41222dcc47f 100644 --- a/gcc/testsuite/g++.dg/tm/pr47554.C +++ b/gcc/testsuite/g++.dg/tm/pr47554.C @@ -11,6 +11,8 @@ class list } const list& _M_get_Node_allocator() const { + static list l; + return l; } list _M_get_Tp_allocator() const { diff --git a/gcc/testsuite/g++.dg/tm/pr47573.C b/gcc/testsuite/g++.dg/tm/pr47573.C index 1fd26896c5d..7410533a5f5 100644 --- a/gcc/testsuite/g++.dg/tm/pr47573.C +++ b/gcc/testsuite/g++.dg/tm/pr47573.C @@ -25,4 +25,5 @@ template > class basic_string int getStringHeight() { basic_string<> tmp; + return 0; } diff --git a/gcc/testsuite/g++.dg/tm/unsafe1.C b/gcc/testsuite/g++.dg/tm/unsafe1.C index 91dd7b110ec..49dd564894a 100644 --- a/gcc/testsuite/g++.dg/tm/unsafe1.C +++ b/gcc/testsuite/g++.dg/tm/unsafe1.C @@ -4,7 +4,7 @@ struct S { virtual ~S(); }; -int f() transaction_safe { +void f() transaction_safe { S s; // { dg-error "unsafe" "invocation of unsafe destructor" } } diff --git a/gcc/testsuite/g++.dg/tm/unsafe2.C b/gcc/testsuite/g++.dg/tm/unsafe2.C index 1b81b310057..b0425ac6cee 100644 --- a/gcc/testsuite/g++.dg/tm/unsafe2.C +++ b/gcc/testsuite/g++.dg/tm/unsafe2.C @@ -6,7 +6,7 @@ void f(T) transaction_safe; template<> void f(bool); // not transaction-safe -int g() transaction_safe +void g() transaction_safe { f(42); // OK f(true); // { dg-error "unsafe" } diff --git a/gcc/testsuite/g++.dg/torture/20070621-1.C b/gcc/testsuite/g++.dg/torture/20070621-1.C index 9bd8cc38c44..d8a6a76b6b0 100644 --- a/gcc/testsuite/g++.dg/torture/20070621-1.C +++ b/gcc/testsuite/g++.dg/torture/20070621-1.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } /* Reduced from libstdc++-v3/testsuite/25_algorithms/equal/1.cc 1.2.ii: In function 'void test1()': diff --git a/gcc/testsuite/g++.dg/torture/20090329-1.C b/gcc/testsuite/g++.dg/torture/20090329-1.C index 0274a1944e5..6839931a247 100644 --- a/gcc/testsuite/g++.dg/torture/20090329-1.C +++ b/gcc/testsuite/g++.dg/torture/20090329-1.C @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ struct input_iterator_tag { }; template diff --git a/gcc/testsuite/g++.dg/torture/20141013.C b/gcc/testsuite/g++.dg/torture/20141013.C index 82aacd6317e..e6c83ffab21 100644 --- a/gcc/testsuite/g++.dg/torture/20141013.C +++ b/gcc/testsuite/g++.dg/torture/20141013.C @@ -1,4 +1,5 @@ /* { dg-options "-fno-short-enums" } */ +/* { dg-additional-options "-Wno-return-type" } */ enum { _sch_isdigit = 0x0004, diff --git a/gcc/testsuite/g++.dg/torture/pr33134.C b/gcc/testsuite/g++.dg/torture/pr33134.C index 43482c7fc04..64e678c6a98 100644 --- a/gcc/testsuite/g++.dg/torture/pr33134.C +++ b/gcc/testsuite/g++.dg/torture/pr33134.C @@ -18,4 +18,5 @@ bool fxsaveGIF (FXStream &store) c1 = 0x80; c1 |= (bitsperpixel - 1) << 4; store << c1; + return true; } diff --git a/gcc/testsuite/g++.dg/torture/pr33340.C b/gcc/testsuite/g++.dg/torture/pr33340.C index bac882156b5..44d3c8e0d0f 100644 --- a/gcc/testsuite/g++.dg/torture/pr33340.C +++ b/gcc/testsuite/g++.dg/torture/pr33340.C @@ -1,4 +1,6 @@ -void* operator new(__SIZE_TYPE__, void* __p) { } +// { dg-additional-options "-Wno-return-type" } + +void* operator new(__SIZE_TYPE__, void* __p) {} struct auto_ptr { int* p; diff --git a/gcc/testsuite/g++.dg/torture/pr33627.C b/gcc/testsuite/g++.dg/torture/pr33627.C index a14e345517f..9265bd95f05 100644 --- a/gcc/testsuite/g++.dg/torture/pr33627.C +++ b/gcc/testsuite/g++.dg/torture/pr33627.C @@ -10,9 +10,9 @@ class PX_ChangeRecord; class pf_Frag { public: typedef enum _PFType { PFT_Object } PFType; - inline PFType getType(void) const { } - inline pf_Frag * getNext(void) const { } - PT_DocPosition getPos(void) const { } + inline PFType getType(void) const { return PFType(); } + inline pf_Frag * getNext(void) const { return 0; } + PT_DocPosition getPos(void) const { return PT_DocPosition(); } }; class pf_Fragments { public: diff --git a/gcc/testsuite/g++.dg/torture/pr34222.C b/gcc/testsuite/g++.dg/torture/pr34222.C index 130896dc9da..dfcb5d7a952 100644 --- a/gcc/testsuite/g++.dg/torture/pr34222.C +++ b/gcc/testsuite/g++.dg/torture/pr34222.C @@ -47,6 +47,7 @@ using namespace std; static float readFloat(ifstream& in) { float f; in.read((char*) &f, sizeof(float)); + return f; } Mat4f readMeshMatrix(ifstream& in, int nBytes) { float m00 = readFloat(in); diff --git a/gcc/testsuite/g++.dg/torture/pr34241.C b/gcc/testsuite/g++.dg/torture/pr34241.C index 70f186c5b9f..0ea9cfc1a0c 100644 --- a/gcc/testsuite/g++.dg/torture/pr34241.C +++ b/gcc/testsuite/g++.dg/torture/pr34241.C @@ -15,4 +15,5 @@ struct A A test () { const A a (42, true); + return a; } diff --git a/gcc/testsuite/g++.dg/torture/pr34641.C b/gcc/testsuite/g++.dg/torture/pr34641.C index 0cf50776281..72a98ad8f46 100644 --- a/gcc/testsuite/g++.dg/torture/pr34641.C +++ b/gcc/testsuite/g++.dg/torture/pr34641.C @@ -2,6 +2,7 @@ // { dg-require-effective-target fpic } // { dg-require-visibility "" } // { dg-options "-fPIC" } +/* { dg-additional-options "-Wno-return-type" } */ typedef __SIZE_TYPE__ size_t; diff --git a/gcc/testsuite/g++.dg/torture/pr34850.C b/gcc/testsuite/g++.dg/torture/pr34850.C index c2538288964..e41620b739d 100644 --- a/gcc/testsuite/g++.dg/torture/pr34850.C +++ b/gcc/testsuite/g++.dg/torture/pr34850.C @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ /* { dg-options "-ffat-lto-objects" } */ +/* { dg-additional-options "-Wno-return-type" } */ typedef unsigned char uint8_t; typedef unsigned int uint32_t; @@ -12,9 +13,7 @@ extern "C" { extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) void * memset (void *__dest, int __ch, size_t __len) throw () { if (__builtin_constant_p (__len) && __len == 0) - __warn_memset_zero_len (); /* { dg-warning "declared with attribute warning" } */ - - return __dest; + __warn_memset_zero_len (); } } inline void clear_mem(void* ptr, u32bit n) { @@ -52,13 +51,11 @@ template class SecureVector : public MemoryRegion { public: SecureVector& operator=(const MemoryRegion& in) { if(this != &in) this->set(in); - return *this; } }; class OctetString { public: SecureVector bits_of() const { - return SecureVector (); } OctetString& operator^=(const OctetString&); void change(const MemoryRegion& in) { @@ -73,8 +70,6 @@ OctetString& OctetString::operator^=(const OctetString& k) { if(&k == this) { bits.clear(); } - - return *this; } bool __attribute__((flatten)) operator==(const OctetString& s1, const OctetString& s2) { diff --git a/gcc/testsuite/g++.dg/torture/pr35164-1.C b/gcc/testsuite/g++.dg/torture/pr35164-1.C index 1704c222656..faa829f5f6f 100644 --- a/gcc/testsuite/g++.dg/torture/pr35164-1.C +++ b/gcc/testsuite/g++.dg/torture/pr35164-1.C @@ -1,3 +1,5 @@ +/* { dg-additional-options "-Wno-return-type" } */ + typedef __SIZE_TYPE__ size_t; template class __normal_iterator { public: diff --git a/gcc/testsuite/g++.dg/torture/pr36745.C b/gcc/testsuite/g++.dg/torture/pr36745.C index 53845aaa78e..56fa9d8028d 100644 --- a/gcc/testsuite/g++.dg/torture/pr36745.C +++ b/gcc/testsuite/g++.dg/torture/pr36745.C @@ -1,6 +1,7 @@ /* PR target/36745 */ /* { dg-do compile } */ /* { dg-options "-O2 -fPIC" } */ +/* { dg-additional-options "-Wno-return-type" } */ /* { dg-require-effective-target fpic } */ typedef __SIZE_TYPE__ size_t; diff --git a/gcc/testsuite/g++.dg/torture/pr38705.C b/gcc/testsuite/g++.dg/torture/pr38705.C index 8058d3a3979..07dec5594ca 100644 --- a/gcc/testsuite/g++.dg/torture/pr38705.C +++ b/gcc/testsuite/g++.dg/torture/pr38705.C @@ -24,4 +24,5 @@ S::bar () const { foo (u); foo (t); + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr38811.C b/gcc/testsuite/g++.dg/torture/pr38811.C index e9b304da6e5..5ced0781497 100644 --- a/gcc/testsuite/g++.dg/torture/pr38811.C +++ b/gcc/testsuite/g++.dg/torture/pr38811.C @@ -17,7 +17,7 @@ public: AbcExtent2d(const AbcA2d & rMin, const AbcA2d & rMax); AbcA2d ClampPoint2d(const AbcA2d & rPoint) const; AbcA2d GetMax() const { return m_vMax; } - AbcA2d GetMin() const { } + AbcA2d GetMin() const { return AbcA2d(); } AbcA2d Evaluate(double dNormalizedX, double dNormalizedY) const; }; inline AbcExtent2d::AbcExtent2d(const AbcA2d & rMin, const AbcA2d & rMax) @@ -69,5 +69,7 @@ long AbcAbcdTracer::TestIsoAbcde(AbcZyParamType eZyParam, double dParam, if (!DoesPointLieOnAbcde(sUV,0)) ; } + + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr39362.C b/gcc/testsuite/g++.dg/torture/pr39362.C index 554f9d06bac..6599fdd70c0 100644 --- a/gcc/testsuite/g++.dg/torture/pr39362.C +++ b/gcc/testsuite/g++.dg/torture/pr39362.C @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ void *fastMalloc (int n); void fastFree (void *p); diff --git a/gcc/testsuite/g++.dg/torture/pr39732.C b/gcc/testsuite/g++.dg/torture/pr39732.C index 4b3975b8db9..44edbf5ba90 100644 --- a/gcc/testsuite/g++.dg/torture/pr39732.C +++ b/gcc/testsuite/g++.dg/torture/pr39732.C @@ -27,4 +27,5 @@ int f(void) { basic_ostream > os; copy(ostream_iterator(os, ",")); + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr40991.C b/gcc/testsuite/g++.dg/torture/pr40991.C index c08124024a7..bce5f7e6893 100644 --- a/gcc/testsuite/g++.dg/torture/pr40991.C +++ b/gcc/testsuite/g++.dg/torture/pr40991.C @@ -1,4 +1,5 @@ /* { dg-options "-std=gnu++0x" } */ +/* { dg-additional-options "-Wno-return-type" } */ typedef __SIZE_TYPE__ size_t; namespace std __attribute__ ((__visibility__ ("default"))) { diff --git a/gcc/testsuite/g++.dg/torture/pr41775.C b/gcc/testsuite/g++.dg/torture/pr41775.C index 3d8548e3fb0..ca24abd0229 100644 --- a/gcc/testsuite/g++.dg/torture/pr41775.C +++ b/gcc/testsuite/g++.dg/torture/pr41775.C @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ /* { dg-require-visibility "" } */ typedef unsigned int size_t; diff --git a/gcc/testsuite/g++.dg/torture/pr42183.C b/gcc/testsuite/g++.dg/torture/pr42183.C index 375b37f0c66..2ae415f0b5a 100644 --- a/gcc/testsuite/g++.dg/torture/pr42183.C +++ b/gcc/testsuite/g++.dg/torture/pr42183.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } class IntSize { public: diff --git a/gcc/testsuite/g++.dg/torture/pr42450.C b/gcc/testsuite/g++.dg/torture/pr42450.C index f630fa2b7e2..5813acb5cb4 100644 --- a/gcc/testsuite/g++.dg/torture/pr42450.C +++ b/gcc/testsuite/g++.dg/torture/pr42450.C @@ -1,4 +1,5 @@ /* { dg-do compile } */ +// { dg-additional-options "-Wno-return-type" } template < typename > class basic_stringstream; diff --git a/gcc/testsuite/g++.dg/torture/pr42704.C b/gcc/testsuite/g++.dg/torture/pr42704.C index 735b1e7bdea..d1cbc8225cd 100644 --- a/gcc/testsuite/g++.dg/torture/pr42704.C +++ b/gcc/testsuite/g++.dg/torture/pr42704.C @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ typedef int PRInt32; class nsTreeRows { diff --git a/gcc/testsuite/g++.dg/torture/pr42760.C b/gcc/testsuite/g++.dg/torture/pr42760.C index be85f7fc408..084fcfdfa68 100644 --- a/gcc/testsuite/g++.dg/torture/pr42760.C +++ b/gcc/testsuite/g++.dg/torture/pr42760.C @@ -16,6 +16,7 @@ baz (T x, T y, U z) *z = *x; ++z; } + return U(); }; template @@ -23,6 +24,7 @@ U bar (T x, T y, U z) { baz (A ::b (x), A ::b (y), A ::b (z)); + return U(); } struct C diff --git a/gcc/testsuite/g++.dg/torture/pr42773.C b/gcc/testsuite/g++.dg/torture/pr42773.C index 478ad278aa6..5d887cefed1 100644 --- a/gcc/testsuite/g++.dg/torture/pr42773.C +++ b/gcc/testsuite/g++.dg/torture/pr42773.C @@ -51,4 +51,5 @@ class Cell { }; QValueList Cell::obscuringCells() const { QValueList empty; + return QValueList(); } diff --git a/gcc/testsuite/g++.dg/torture/pr42883.C b/gcc/testsuite/g++.dg/torture/pr42883.C index f164c3781f5..ad2ae251637 100644 --- a/gcc/testsuite/g++.dg/torture/pr42883.C +++ b/gcc/testsuite/g++.dg/torture/pr42883.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } typedef __SIZE_TYPE__ size_t; namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { diff --git a/gcc/testsuite/g++.dg/torture/pr43905.C b/gcc/testsuite/g++.dg/torture/pr43905.C index 0e49a32a1dd..259ea785041 100644 --- a/gcc/testsuite/g++.dg/torture/pr43905.C +++ b/gcc/testsuite/g++.dg/torture/pr43905.C @@ -2,9 +2,11 @@ extern void sf ( __const char *); struct Matrix{ int operator[](int n){ sf ( __PRETTY_FUNCTION__); + return 0; } int operator[](int n)const{ sf ( __PRETTY_FUNCTION__); + return 0; } }; void calcmy(Matrix const &b, Matrix &c, int k){ diff --git a/gcc/testsuite/g++.dg/torture/pr44148.C b/gcc/testsuite/g++.dg/torture/pr44148.C index a60ba9aa3a6..cebfccba5d6 100644 --- a/gcc/testsuite/g++.dg/torture/pr44148.C +++ b/gcc/testsuite/g++.dg/torture/pr44148.C @@ -2,6 +2,7 @@ // { dg-do compile } // { dg-options "" } // { dg-options "-fpic" { target fpic } } +// { dg-additional-options "-Wno-return-type" } template struct S2 { diff --git a/gcc/testsuite/g++.dg/torture/pr44295.C b/gcc/testsuite/g++.dg/torture/pr44295.C index 8169bb0a873..7525dc41a78 100644 --- a/gcc/testsuite/g++.dg/torture/pr44295.C +++ b/gcc/testsuite/g++.dg/torture/pr44295.C @@ -1,4 +1,6 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ + extern "C" { typedef __SIZE_TYPE__ size_t; typedef struct { diff --git a/gcc/testsuite/g++.dg/torture/pr44357.C b/gcc/testsuite/g++.dg/torture/pr44357.C index 3380350e81b..2ffb6d07f7e 100644 --- a/gcc/testsuite/g++.dg/torture/pr44357.C +++ b/gcc/testsuite/g++.dg/torture/pr44357.C @@ -1,4 +1,6 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ + extern "C" { typedef long unsigned int size_t; diff --git a/gcc/testsuite/g++.dg/torture/pr44813.C b/gcc/testsuite/g++.dg/torture/pr44813.C index 1dc01b06a17..6ec1b60adc4 100644 --- a/gcc/testsuite/g++.dg/torture/pr44813.C +++ b/gcc/testsuite/g++.dg/torture/pr44813.C @@ -1,3 +1,5 @@ +/* { dg-additional-options "-Wno-return-type" } */ + typedef unsigned int PRUint32; typedef int PRInt32; typedef unsigned long PRUint64; diff --git a/gcc/testsuite/g++.dg/torture/pr45580.C b/gcc/testsuite/g++.dg/torture/pr45580.C index c3af4910aeb..5728c0382bb 100644 --- a/gcc/testsuite/g++.dg/torture/pr45580.C +++ b/gcc/testsuite/g++.dg/torture/pr45580.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } namespace std { typedef __SIZE_TYPE__ size_t; diff --git a/gcc/testsuite/g++.dg/torture/pr45874.C b/gcc/testsuite/g++.dg/torture/pr45874.C index 70965ff574e..37c2ccc8a3a 100644 --- a/gcc/testsuite/g++.dg/torture/pr45874.C +++ b/gcc/testsuite/g++.dg/torture/pr45874.C @@ -48,6 +48,7 @@ Status Mpeg2FrameConstructor::ParsePictureHeader(Ipp8u *buf, Ipp32s iLen, Mpeg2T bs.SkipBits(10); } } + return Status(); } void BitstreamReader::SkipBits(Ipp32s iNum) { if (iNum <= m_iReadyBits) { diff --git a/gcc/testsuite/g++.dg/torture/pr45877.C b/gcc/testsuite/g++.dg/torture/pr45877.C index 9af6ae99985..1754fb5cb5c 100644 --- a/gcc/testsuite/g++.dg/torture/pr45877.C +++ b/gcc/testsuite/g++.dg/torture/pr45877.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } namespace std __attribute__ ((__visibility__ ("default"))) { diff --git a/gcc/testsuite/g++.dg/torture/pr46383.C b/gcc/testsuite/g++.dg/torture/pr46383.C index e4810c5ada8..ee00f358ea2 100644 --- a/gcc/testsuite/g++.dg/torture/pr46383.C +++ b/gcc/testsuite/g++.dg/torture/pr46383.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } namespace std { templatestruct pair{}; diff --git a/gcc/testsuite/g++.dg/torture/pr46469.C b/gcc/testsuite/g++.dg/torture/pr46469.C index 8212ea4f9e2..c16a0f277a7 100644 --- a/gcc/testsuite/g++.dg/torture/pr46469.C +++ b/gcc/testsuite/g++.dg/torture/pr46469.C @@ -1,5 +1,6 @@ extern "C" __inline __attribute__ ((__gnu_inline__)) int pthread_equal () { + return 0; } static @@ -10,4 +11,5 @@ static int identifierByPthreadHandle () { pthread_equal (); + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr47313.C b/gcc/testsuite/g++.dg/torture/pr47313.C index c10f558a3eb..787445ed595 100644 --- a/gcc/testsuite/g++.dg/torture/pr47313.C +++ b/gcc/testsuite/g++.dg/torture/pr47313.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } namespace internal { template < class DSC, bool Const > struct CC_iterator { diff --git a/gcc/testsuite/g++.dg/torture/pr48271.C b/gcc/testsuite/g++.dg/torture/pr48271.C index 5b60ccd768c..2e3eb5bfd05 100644 --- a/gcc/testsuite/g++.dg/torture/pr48271.C +++ b/gcc/testsuite/g++.dg/torture/pr48271.C @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "-ftree-vrp -fno-guess-branch-probability -fnon-call-exceptions" } +// { dg-additional-options "-Wno-return-type" } void *xalloc (); void xfree (void *); diff --git a/gcc/testsuite/g++.dg/torture/pr49615.C b/gcc/testsuite/g++.dg/torture/pr49615.C index 98a2f95b8b3..bc5182b2716 100644 --- a/gcc/testsuite/g++.dg/torture/pr49615.C +++ b/gcc/testsuite/g++.dg/torture/pr49615.C @@ -5,6 +5,7 @@ template static inline bool Dispatch (T* obj, void (T::*func) ()) { (obj->*func) (); + return true; } class C { @@ -21,6 +22,8 @@ bool C::f (int n) case 1: b = Dispatch (this, &C::g); } + + return true; } void C::g () { diff --git a/gcc/testsuite/g++.dg/torture/pr49770.C b/gcc/testsuite/g++.dg/torture/pr49770.C index 7eac9e0d9bb..794bf3dba19 100644 --- a/gcc/testsuite/g++.dg/torture/pr49770.C +++ b/gcc/testsuite/g++.dg/torture/pr49770.C @@ -79,8 +79,10 @@ test01 () __builtin_abort (); } +int main () { test01 (); + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr49938.C b/gcc/testsuite/g++.dg/torture/pr49938.C index 91804f4b0d5..d2c73e73871 100644 --- a/gcc/testsuite/g++.dg/torture/pr49938.C +++ b/gcc/testsuite/g++.dg/torture/pr49938.C @@ -43,6 +43,8 @@ namespace net { } scoped_array signed_data(new unsigned char[signed_data_len]); + + return true; } } diff --git a/gcc/testsuite/g++.dg/torture/pr51436.C b/gcc/testsuite/g++.dg/torture/pr51436.C index 43d6c730032..b01a33ca243 100644 --- a/gcc/testsuite/g++.dg/torture/pr51436.C +++ b/gcc/testsuite/g++.dg/torture/pr51436.C @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ typedef __SIZE_TYPE__ size_t; extern "C" void *memcpy (void *, __const void *, size_t); diff --git a/gcc/testsuite/g++.dg/torture/pr51482.C b/gcc/testsuite/g++.dg/torture/pr51482.C index 28435919f46..4032703f720 100644 --- a/gcc/testsuite/g++.dg/torture/pr51482.C +++ b/gcc/testsuite/g++.dg/torture/pr51482.C @@ -27,4 +27,5 @@ WVECT * anim_track_bez_wvect::tangent(int kn, BEZIER_KEY_CLASS key_class, WVECT p_tn->y = (g1.y + g3.y*bp1)*tn1; p_tn->z = (g1.z + g3.z*bp1)*tn1; p_tn->w = (g1.w + g3.w*bp1)*tn1; + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr51737.C b/gcc/testsuite/g++.dg/torture/pr51737.C index ff77edbf3d3..90edafffc88 100644 --- a/gcc/testsuite/g++.dg/torture/pr51737.C +++ b/gcc/testsuite/g++.dg/torture/pr51737.C @@ -20,6 +20,7 @@ struct id_state { }; void * id_state::start_file(void) { intrusive_ptr parent; + return 0; } struct id_generation_data : intrusive_base { void child_length() const {} diff --git a/gcc/testsuite/g++.dg/torture/pr51959.C b/gcc/testsuite/g++.dg/torture/pr51959.C index da0be71ebd8..1c98f4f6cc8 100644 --- a/gcc/testsuite/g++.dg/torture/pr51959.C +++ b/gcc/testsuite/g++.dg/torture/pr51959.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } namespace std { typedef __SIZE_TYPE__ size_t; diff --git a/gcc/testsuite/g++.dg/torture/pr52772.C b/gcc/testsuite/g++.dg/torture/pr52772.C index 810e6579fba..0109f137676 100644 --- a/gcc/testsuite/g++.dg/torture/pr52772.C +++ b/gcc/testsuite/g++.dg/torture/pr52772.C @@ -46,7 +46,7 @@ class c5 : public c2 { }; class c6 { - public: int get() const {}; + public: int get() const { return 0; }; }; class c7 { diff --git a/gcc/testsuite/g++.dg/torture/pr52918-2.C b/gcc/testsuite/g++.dg/torture/pr52918-2.C index ba31295e41e..185444bdd0e 100644 --- a/gcc/testsuite/g++.dg/torture/pr52918-2.C +++ b/gcc/testsuite/g++.dg/torture/pr52918-2.C @@ -37,4 +37,5 @@ void * __cxa_allocate_exception(size_t thrown_size) throw() void *ret; if (! ret) __scoped_lock sentry(emergency_mutex); + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr53011.C b/gcc/testsuite/g++.dg/torture/pr53011.C index 2cd8a60332d..4882f23b19e 100644 --- a/gcc/testsuite/g++.dg/torture/pr53011.C +++ b/gcc/testsuite/g++.dg/torture/pr53011.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } extern "C" class WvFastString; typedef WvFastString& WvStringParm; diff --git a/gcc/testsuite/g++.dg/torture/pr53602.C b/gcc/testsuite/g++.dg/torture/pr53602.C index 1bb9cf4faaf..67d9ed848f0 100644 --- a/gcc/testsuite/g++.dg/torture/pr53602.C +++ b/gcc/testsuite/g++.dg/torture/pr53602.C @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "-std=c++11" } +// { dg-additional-options "-Wno-return-type" } namespace std { diff --git a/gcc/testsuite/g++.dg/torture/pr53752.C b/gcc/testsuite/g++.dg/torture/pr53752.C index fd6c687667c..61febdeb6b8 100644 --- a/gcc/testsuite/g++.dg/torture/pr53752.C +++ b/gcc/testsuite/g++.dg/torture/pr53752.C @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "-g" } +// { dg-additional-options "-Wno-return-type" } typedef unsigned int uint32_t; typedef unsigned long int uint64_t; diff --git a/gcc/testsuite/g++.dg/torture/pr54838.C b/gcc/testsuite/g++.dg/torture/pr54838.C index 6d34d57a486..c3308210ebe 100644 --- a/gcc/testsuite/g++.dg/torture/pr54838.C +++ b/gcc/testsuite/g++.dg/torture/pr54838.C @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "-ftracer -fno-tree-dce -fno-tree-sra" } +// { dg-additional-options "-Wno-return-type" } struct bidirectional_iterator_tag {}; diff --git a/gcc/testsuite/g++.dg/torture/pr54902.C b/gcc/testsuite/g++.dg/torture/pr54902.C index 790ffe5fcb5..84707bd7136 100644 --- a/gcc/testsuite/g++.dg/torture/pr54902.C +++ b/gcc/testsuite/g++.dg/torture/pr54902.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } namespace std __attribute__ ((__visibility__ ("default"))) { template struct iterator_traits { diff --git a/gcc/testsuite/g++.dg/torture/pr56029.C b/gcc/testsuite/g++.dg/torture/pr56029.C index ca4a82a0060..72ad59b4354 100644 --- a/gcc/testsuite/g++.dg/torture/pr56029.C +++ b/gcc/testsuite/g++.dg/torture/pr56029.C @@ -1,5 +1,6 @@ // PR tree-optimization/56029 // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } template struct DefaultDeleter diff --git a/gcc/testsuite/g++.dg/torture/pr56768.C b/gcc/testsuite/g++.dg/torture/pr56768.C index db504c500e0..b2be74f28e4 100644 --- a/gcc/testsuite/g++.dg/torture/pr56768.C +++ b/gcc/testsuite/g++.dg/torture/pr56768.C @@ -7,7 +7,7 @@ struct Iter void operator++ (); }; -bool operator!= (Iter &, Iter &) { } +bool operator!= (Iter &, Iter &) { return true; } struct Container { diff --git a/gcc/testsuite/g++.dg/torture/pr57107.C b/gcc/testsuite/g++.dg/torture/pr57107.C index 516dec16fc5..4dbd32bd298 100644 --- a/gcc/testsuite/g++.dg/torture/pr57107.C +++ b/gcc/testsuite/g++.dg/torture/pr57107.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } typedef long unsigned int size_t; namespace std { diff --git a/gcc/testsuite/g++.dg/torture/pr57140.C b/gcc/testsuite/g++.dg/torture/pr57140.C index 2ea2f9c4d1b..654653d53aa 100644 --- a/gcc/testsuite/g++.dg/torture/pr57140.C +++ b/gcc/testsuite/g++.dg/torture/pr57140.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } namespace std { typedef long unsigned int size_t; diff --git a/gcc/testsuite/g++.dg/torture/pr57235.C b/gcc/testsuite/g++.dg/torture/pr57235.C index fd5663348e9..8a9e522a36a 100644 --- a/gcc/testsuite/g++.dg/torture/pr57235.C +++ b/gcc/testsuite/g++.dg/torture/pr57235.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } namespace std { diff --git a/gcc/testsuite/g++.dg/torture/pr58252.C b/gcc/testsuite/g++.dg/torture/pr58252.C index d38a7a7ea4b..db3270d9afb 100644 --- a/gcc/testsuite/g++.dg/torture/pr58252.C +++ b/gcc/testsuite/g++.dg/torture/pr58252.C @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "-fpermissive" } +// { dg-additional-options "-Wno-return-type" } typedef long unsigned int size_t; typedef bool _CORBA_Boolean; typedef unsigned int _CORBA_ULong; diff --git a/gcc/testsuite/g++.dg/torture/pr58555.C b/gcc/testsuite/g++.dg/torture/pr58555.C index ac5009a7b26..454d33d8740 100644 --- a/gcc/testsuite/g++.dg/torture/pr58555.C +++ b/gcc/testsuite/g++.dg/torture/pr58555.C @@ -1,4 +1,6 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ + template _Tp *__addressof(_Tp &) {} template class A { public: diff --git a/gcc/testsuite/g++.dg/torture/pr59208.C b/gcc/testsuite/g++.dg/torture/pr59208.C index 3dc110c55e3..2b2ad6deea5 100644 --- a/gcc/testsuite/g++.dg/torture/pr59208.C +++ b/gcc/testsuite/g++.dg/torture/pr59208.C @@ -14,7 +14,7 @@ enum DebuggerType {}; C a; DebuggerType b; void operator==(A &, const A &); -static A get_dbx_doc(A &p1) { p1 == 0; } +static A get_dbx_doc(A &p1) { p1 == 0; return A(); } void add_button() { A c; diff --git a/gcc/testsuite/g++.dg/torture/pr60438-1.C b/gcc/testsuite/g++.dg/torture/pr60438-1.C index 748295aabe0..3f79dd770eb 100644 --- a/gcc/testsuite/g++.dg/torture/pr60438-1.C +++ b/gcc/testsuite/g++.dg/torture/pr60438-1.C @@ -23,4 +23,6 @@ foo (struct C *y, float x) d.a = (int) (b * x); } baz (&d); + + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr60746.C b/gcc/testsuite/g++.dg/torture/pr60746.C index 7ce6ebe6bc0..941e42ca783 100644 --- a/gcc/testsuite/g++.dg/torture/pr60746.C +++ b/gcc/testsuite/g++.dg/torture/pr60746.C @@ -20,4 +20,6 @@ Two::run () || list_arry[4][orig].getSize () > 0) { } + + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr61554.C b/gcc/testsuite/g++.dg/torture/pr61554.C index 6f609c8be09..90f8e85e303 100644 --- a/gcc/testsuite/g++.dg/torture/pr61554.C +++ b/gcc/testsuite/g++.dg/torture/pr61554.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } struct A { diff --git a/gcc/testsuite/g++.dg/torture/pr63419.C b/gcc/testsuite/g++.dg/torture/pr63419.C index 6d4c0745d41..88b117883b7 100644 --- a/gcc/testsuite/g++.dg/torture/pr63419.C +++ b/gcc/testsuite/g++.dg/torture/pr63419.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-additional-options "-Wno-psabi" } +// { dg-additional-options "-Wno-psabi -Wno-return-type" } // Ignore warning on some powerpc-linux configurations. // { dg-prune-output "non-standard ABI extension" } diff --git a/gcc/testsuite/g++.dg/torture/pr63476.C b/gcc/testsuite/g++.dg/torture/pr63476.C index 75ecc374065..c0c8ae44e85 100644 --- a/gcc/testsuite/g++.dg/torture/pr63476.C +++ b/gcc/testsuite/g++.dg/torture/pr63476.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-additional-options "-std=gnu++11" } +// { dg-additional-options "-std=gnu++11 -Wno-return-type" } enum class nsresult; class A; diff --git a/gcc/testsuite/g++.dg/torture/pr63512.C b/gcc/testsuite/g++.dg/torture/pr63512.C index 1c1899dc6d8..d08e6174168 100644 --- a/gcc/testsuite/g++.dg/torture/pr63512.C +++ b/gcc/testsuite/g++.dg/torture/pr63512.C @@ -43,4 +43,5 @@ C::m_fn3 (const int &, int &, int **) if (a) c.Range.m_fn1 (); m_fn2 (semi, 0, b ? "" : a ? "alias declaration" : "using declaration"); + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr64282.C b/gcc/testsuite/g++.dg/torture/pr64282.C index 48429884e9f..9696effc38d 100644 --- a/gcc/testsuite/g++.dg/torture/pr64282.C +++ b/gcc/testsuite/g++.dg/torture/pr64282.C @@ -53,7 +53,7 @@ public: class H { void m_fn7 (const F &, bool &); - bool m_fn8 (const D &, const F &, F &); + void m_fn8 (const D &, const F &, F &); }; typedef A CandPair; class I @@ -91,7 +91,7 @@ H::m_fn7 (const F &, bool &) F h; m_fn8 (g, f.first, h); } -bool +void H::m_fn8 (const D &p1, const F &, F &) { F i; diff --git a/gcc/testsuite/g++.dg/torture/pr64378.C b/gcc/testsuite/g++.dg/torture/pr64378.C index 6770601eaf2..4d48cdc0946 100644 --- a/gcc/testsuite/g++.dg/torture/pr64378.C +++ b/gcc/testsuite/g++.dg/torture/pr64378.C @@ -5,7 +5,7 @@ struct data { }; struct top { - virtual int topf() {} + virtual int topf() { return 0; } }; struct child1: top { diff --git a/gcc/testsuite/g++.dg/torture/pr64565.C b/gcc/testsuite/g++.dg/torture/pr64565.C index 42b0239c525..ea5ca14e23a 100644 --- a/gcc/testsuite/g++.dg/torture/pr64565.C +++ b/gcc/testsuite/g++.dg/torture/pr64565.C @@ -1,4 +1,6 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ + typedef enum { NS_OK diff --git a/gcc/testsuite/g++.dg/torture/pr64568-2.C b/gcc/testsuite/g++.dg/torture/pr64568-2.C index 05782179008..5881b854d6a 100644 --- a/gcc/testsuite/g++.dg/torture/pr64568-2.C +++ b/gcc/testsuite/g++.dg/torture/pr64568-2.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } namespace std { diff --git a/gcc/testsuite/g++.dg/torture/pr64669.C b/gcc/testsuite/g++.dg/torture/pr64669.C index b207739e6d3..a4e7d3a8a28 100644 --- a/gcc/testsuite/g++.dg/torture/pr64669.C +++ b/gcc/testsuite/g++.dg/torture/pr64669.C @@ -60,4 +60,6 @@ Lex::advance_one_char (const char *p, bool is_single_quote, && (*value == '\'' || *value == '\n') && !issued_error) error_at (this->location (), "invalid character literal"); } + + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr64686.C b/gcc/testsuite/g++.dg/torture/pr64686.C index 714aa4100c5..9eb54160eba 100644 --- a/gcc/testsuite/g++.dg/torture/pr64686.C +++ b/gcc/testsuite/g++.dg/torture/pr64686.C @@ -15,5 +15,6 @@ A * B::m_fn1 (int *) const { new B (m_fn2 (0)->m_fn1 (0), 0, m_fn2 (0)->m_fn1 (0)); + return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr64978.C b/gcc/testsuite/g++.dg/torture/pr64978.C index a9ac49f8e12..3e45be6f09c 100644 --- a/gcc/testsuite/g++.dg/torture/pr64978.C +++ b/gcc/testsuite/g++.dg/torture/pr64978.C @@ -27,4 +27,4 @@ void C::m_fn3(A, unsigned, const int *, int &) { 1 ? VTables.m_fn2() : 0; } void B::m_fn1(bool, const int *, int &) { C(); } -unsigned B::m_fn2() { m_fn1(0, 0, a); } +unsigned B::m_fn2() { m_fn1(0, 0, a); return 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr64995.C b/gcc/testsuite/g++.dg/torture/pr64995.C index f5b97cf371b..f2e1b1b3748 100644 --- a/gcc/testsuite/g++.dg/torture/pr64995.C +++ b/gcc/testsuite/g++.dg/torture/pr64995.C @@ -20,6 +20,7 @@ inline int *A::m_fn2() { a = acos(c); double d = m_fn1(b); acos(d); + return 0; } void passTime() { diff --git a/gcc/testsuite/g++.dg/torture/pr65655.C b/gcc/testsuite/g++.dg/torture/pr65655.C index 8dfc13b7d7d..ea07d2e976b 100644 --- a/gcc/testsuite/g++.dg/torture/pr65655.C +++ b/gcc/testsuite/g++.dg/torture/pr65655.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ // { dg-timeout-factor 2.0 } -// { dg-additional-options "-std=c++11 -fsanitize=undefined -O2" } +// { dg-additional-options "-std=c++11 -fsanitize=undefined -O2 -Wno-return-type" } class ECoordinate { }; class EPoint { public: diff --git a/gcc/testsuite/g++.dg/torture/pr65851.C b/gcc/testsuite/g++.dg/torture/pr65851.C index 6efe8861a19..81f3184296c 100644 --- a/gcc/testsuite/g++.dg/torture/pr65851.C +++ b/gcc/testsuite/g++.dg/torture/pr65851.C @@ -16,6 +16,7 @@ class C : A { public: unsigned long write(const char *p1, unsigned long p2) { m_string.push_range(p1 + p2); + return 0; } }; char *write_signed_decimal_backward(bool) { diff --git a/gcc/testsuite/g++.dg/torture/pr67055.C b/gcc/testsuite/g++.dg/torture/pr67055.C index 7cbbca275c2..6621e58136f 100644 --- a/gcc/testsuite/g++.dg/torture/pr67055.C +++ b/gcc/testsuite/g++.dg/torture/pr67055.C @@ -15,6 +15,7 @@ namespace vespamalloc { unsigned long A::fillStack(unsigned long p1) { void *retAddr[p1]; fn1(retAddr); + return 0; } class B { protected: @@ -33,6 +34,7 @@ namespace vespamalloc { void *C::malloc(unsigned long) { MemBlockPtrT mem; mem.alloc(0); + return 0; } C, int> *_GmemP; } diff --git a/gcc/testsuite/g++.dg/torture/pr67191.C b/gcc/testsuite/g++.dg/torture/pr67191.C index 79ee988ce7a..997c661d3ec 100644 --- a/gcc/testsuite/g++.dg/torture/pr67191.C +++ b/gcc/testsuite/g++.dg/torture/pr67191.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } template class A; template using __allocator_base = _Tp; diff --git a/gcc/testsuite/g++.dg/torture/pr68852.C b/gcc/testsuite/g++.dg/torture/pr68852.C index 41727517760..c2c6a585d3c 100644 --- a/gcc/testsuite/g++.dg/torture/pr68852.C +++ b/gcc/testsuite/g++.dg/torture/pr68852.C @@ -34,6 +34,7 @@ public: c[2] = m_fn2(b); c[3] = m_fn2(a); c[ProjectRectBounds_next].m_fn1(); + return 0; } D operator*(D p1) { D d; diff --git a/gcc/testsuite/g++.dg/torture/pr69264.C b/gcc/testsuite/g++.dg/torture/pr69264.C index 43753806758..a531bfc9b8c 100644 --- a/gcc/testsuite/g++.dg/torture/pr69264.C +++ b/gcc/testsuite/g++.dg/torture/pr69264.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } // { dg-additional-options "-mcpu=970 -maltivec" { target powerpc*-*-* } } typedef union { diff --git a/gcc/testsuite/g++.dg/torture/pr70971.C b/gcc/testsuite/g++.dg/torture/pr70971.C index 23f33aafaba..b4ce235110f 100644 --- a/gcc/testsuite/g++.dg/torture/pr70971.C +++ b/gcc/testsuite/g++.dg/torture/pr70971.C @@ -1,4 +1,4 @@ -// { dg-additional-options "-std=c++14" } +// { dg-additional-options "-std=c++14 -Wno-return-type" } template class function; diff --git a/gcc/testsuite/g++.dg/torture/pr77674.C b/gcc/testsuite/g++.dg/torture/pr77674.C index f933174317e..a24ce58dafc 100644 --- a/gcc/testsuite/g++.dg/torture/pr77674.C +++ b/gcc/testsuite/g++.dg/torture/pr77674.C @@ -3,6 +3,7 @@ typedef struct { } __fsid_t; typedef unsigned long int pthread_t; extern "C" { extern __inline __attribute__ ((__gnu_inline__)) int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw () { + return 0; } } typedef pthread_t __gthread_t; diff --git a/gcc/testsuite/g++.dg/torture/pr77947.C b/gcc/testsuite/g++.dg/torture/pr77947.C index 3c8a24a16c6..14f8b13a864 100644 --- a/gcc/testsuite/g++.dg/torture/pr77947.C +++ b/gcc/testsuite/g++.dg/torture/pr77947.C @@ -18,9 +18,12 @@ B::m_fn2 () const bool m_fn1 () const { + return true; } C () {} }; + + return 0; } void fn1 (A &p1) diff --git a/gcc/testsuite/g++.dg/torture/pr78268.C b/gcc/testsuite/g++.dg/torture/pr78268.C index ef4547c1159..8458c20d417 100644 --- a/gcc/testsuite/g++.dg/torture/pr78268.C +++ b/gcc/testsuite/g++.dg/torture/pr78268.C @@ -1,4 +1,6 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } + typedef enum {} nsresult; struct A { diff --git a/gcc/testsuite/g++.dg/torture/pr78507.C b/gcc/testsuite/g++.dg/torture/pr78507.C index 9691cf9bd7a..6d6bd31c571 100644 --- a/gcc/testsuite/g++.dg/torture/pr78507.C +++ b/gcc/testsuite/g++.dg/torture/pr78507.C @@ -1,5 +1,7 @@ // PR middle-end/78507 // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } + struct A { template int operator()(_Iterator1, _Iterator2); diff --git a/gcc/testsuite/g++.dg/torture/pr78692.C b/gcc/testsuite/g++.dg/torture/pr78692.C index 57a0d2fcb0a..331cc81c210 100644 --- a/gcc/testsuite/g++.dg/torture/pr78692.C +++ b/gcc/testsuite/g++.dg/torture/pr78692.C @@ -22,5 +22,6 @@ int F::g () { a = i (h, b, 0); + return 0; } } diff --git a/gcc/testsuite/g++.dg/torture/pr80171.C b/gcc/testsuite/g++.dg/torture/pr80171.C index 81f272583c5..c1f6e622515 100644 --- a/gcc/testsuite/g++.dg/torture/pr80171.C +++ b/gcc/testsuite/g++.dg/torture/pr80171.C @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-return-type" } template struct remove_reference; template struct remove_reference<_Tp &> { typedef _Tp type; }; diff --git a/gcc/testsuite/g++.dg/torture/pr82154.C b/gcc/testsuite/g++.dg/torture/pr82154.C index f4e1c3ea139..e229c3e640e 100644 --- a/gcc/testsuite/g++.dg/torture/pr82154.C +++ b/gcc/testsuite/g++.dg/torture/pr82154.C @@ -25,6 +25,7 @@ class f i () { static d j; + return d(); } int *k () throw (a::c); }; @@ -47,4 +48,5 @@ int *f::k () throw (a::c) } } i ().e (); + return 0; } diff --git a/gcc/testsuite/g++.dg/tree-ssa/copyprop.C b/gcc/testsuite/g++.dg/tree-ssa/copyprop.C index b30e5ddc5ba..8c05895e45e 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/copyprop.C +++ b/gcc/testsuite/g++.dg/tree-ssa/copyprop.C @@ -2,7 +2,7 @@ // // { dg-do compile { target { lp64 } } } // { dg-options "-Wno-error -fno-exceptions -fno-tree-vrp -O2 -fprofile-generate -finline-limit=500 -std=c++98" } -// +// { dg-additional-options "-Wno-return-type" } #include #include diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr22444.C b/gcc/testsuite/g++.dg/tree-ssa/pr22444.C index 7df4b9cce15..04bf2009cbe 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr22444.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr22444.C @@ -4,6 +4,7 @@ // with the subvars leading to the subvars not being renamed when they should // { dg-do compile } // { dg-options "-O2" } +// { dg-additional-options "-Wno-return-type" } __extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t; __extension__ typedef __SIZE_TYPE__ size_t; namespace std diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr23948.C b/gcc/testsuite/g++.dg/tree-ssa/pr23948.C index def01d95157..ed99217a7b9 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr23948.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr23948.C @@ -6,7 +6,7 @@ struct MIOFILE { }; double potentially_runnable_resource_share(); void f1(double); -int make_scheduler_request(double a, double b) +void make_scheduler_request(double a, double b) { MIOFILE mf; double prrs = potentially_runnable_resource_share(); diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr24172.C b/gcc/testsuite/g++.dg/tree-ssa/pr24172.C index 245186a3c50..4d92bd592c0 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr24172.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr24172.C @@ -1,6 +1,6 @@ // { dg-options "-O2" } void IOException( char); -inline int* dummy( const char* const mode ) +inline void dummy( const char* const mode ) { IOException(*mode+*mode); } diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr24351-3.C b/gcc/testsuite/g++.dg/tree-ssa/pr24351-3.C index 09a3f9462f3..f3aaee85286 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr24351-3.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr24351-3.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ +// { dg-additional-options "-Wno-return-type" } namespace sigc { template struct type_trait { typedef T_type& pass; diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr27283.C b/gcc/testsuite/g++.dg/tree-ssa/pr27283.C index 224ea6a9bf9..1623d289a20 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr27283.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr27283.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ +/* { dg-additional-options "-Wno-return-type" } */ namespace Gambit { diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr27291.C b/gcc/testsuite/g++.dg/tree-ssa/pr27291.C index b8b5e136a46..24f440dde06 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr27291.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr27291.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ +/* { dg-additional-options "-Wno-return-type" } */ namespace std { diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr27548.C b/gcc/testsuite/g++.dg/tree-ssa/pr27548.C index d23b959a599..cbe7929aefe 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr27548.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr27548.C @@ -1,6 +1,7 @@ // PR tree-optimization/27548 // { dg-do compile } // { dg-options "-O1" } +// { dg-additional-options "-Wno-return-type" } namespace Gambit { diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr34355.C b/gcc/testsuite/g++.dg/tree-ssa/pr34355.C index 978ed75df68..e7b4537697a 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr34355.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr34355.C @@ -24,4 +24,5 @@ double Parse_Float () EXPRESS Express = {1.0, 2.0, 3.0, 4.0, 5.0}; Parse_Rel_Factor (Express, &Terms); + return 0.0; } diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr42337.C b/gcc/testsuite/g++.dg/tree-ssa/pr42337.C index 8abd4b2d161..61beb737018 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr42337.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr42337.C @@ -1,6 +1,7 @@ // PR tree-optimize/42337 // { dg-do compile } // { dg-options "-O2" } +// { dg-additional-options "-Wno-return-type" } template struct pair { _T2 second; diff --git a/gcc/testsuite/g++.dg/tree-ssa/pred-1.C b/gcc/testsuite/g++.dg/tree-ssa/pred-1.C index 01b065ee966..19a066ab48d 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pred-1.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pred-1.C @@ -2,6 +2,8 @@ /* { dg-options "-O2 -fdump-tree-profile_estimate" } */ int a[100]; void foo(int); + +int main() { int i; @@ -11,5 +13,7 @@ main() continue; foo(i); } + + return 0; } // { dg-final { scan-tree-dump "continue heuristics" "profile_estimate" } } diff --git a/gcc/testsuite/g++.dg/ubsan/pr65019.C b/gcc/testsuite/g++.dg/ubsan/pr65019.C index a7f21a7d241..380c10b65d1 100644 --- a/gcc/testsuite/g++.dg/ubsan/pr65019.C +++ b/gcc/testsuite/g++.dg/ubsan/pr65019.C @@ -17,6 +17,8 @@ C::foo (const A &x, int y) C *d = new C (x, y); if (d->c == nullptr) delete d; + + return 0; } C::~C () diff --git a/gcc/testsuite/g++.dg/ubsan/pr65583.C b/gcc/testsuite/g++.dg/ubsan/pr65583.C index 4e1149e9cb6..02acb361a22 100644 --- a/gcc/testsuite/g++.dg/ubsan/pr65583.C +++ b/gcc/testsuite/g++.dg/ubsan/pr65583.C @@ -1,6 +1,7 @@ // PR sanitizer/65583 // { dg-do compile } // { dg-options "-std=c++11 -fsanitize=undefined" } +// { dg-additional-options "-Wno-return-type" } namespace std { diff --git a/gcc/testsuite/g++.dg/vect/pr60836.cc b/gcc/testsuite/g++.dg/vect/pr60836.cc index 425106dd44d..b2d66ec5b15 100644 --- a/gcc/testsuite/g++.dg/vect/pr60836.cc +++ b/gcc/testsuite/g++.dg/vect/pr60836.cc @@ -27,6 +27,8 @@ norm_ (const int &) b = e (b, d); b = e (b, c); } + + return 0.0; } void diff --git a/gcc/testsuite/g++.dg/vect/pr68145.cc b/gcc/testsuite/g++.dg/vect/pr68145.cc index 51e663ae636..8a1e10ee783 100644 --- a/gcc/testsuite/g++.dg/vect/pr68145.cc +++ b/gcc/testsuite/g++.dg/vect/pr68145.cc @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ struct A { bool operator()(int p1, int p2) { return p1 && p2; } diff --git a/gcc/testsuite/g++.dg/vect/pr70729-nest.cc b/gcc/testsuite/g++.dg/vect/pr70729-nest.cc index 96171e5ec94..931895b0a9c 100644 --- a/gcc/testsuite/g++.dg/vect/pr70729-nest.cc +++ b/gcc/testsuite/g++.dg/vect/pr70729-nest.cc @@ -2,7 +2,7 @@ // { dg-additional-options "-ffast-math -fopenmp-simd" } // { dg-additional-options "-msse2" { target x86_64-*-* i?86-*-* } } -inline void* my_alloc (__SIZE_TYPE__ bytes) {void *ptr; __builtin_posix_memalign (&ptr, bytes, 128);} +inline void* my_alloc (__SIZE_TYPE__ bytes) {void *ptr; __builtin_posix_memalign (&ptr, bytes, 128); return 0; } inline void my_free (void* memory) {__builtin_free (memory);} float W[100]; diff --git a/gcc/testsuite/g++.dg/vect/pr70729.cc b/gcc/testsuite/g++.dg/vect/pr70729.cc index ff868f7a41b..eac4b4bd75c 100644 --- a/gcc/testsuite/g++.dg/vect/pr70729.cc +++ b/gcc/testsuite/g++.dg/vect/pr70729.cc @@ -2,7 +2,7 @@ // { dg-additional-options "-ffast-math -fopenmp-simd" } // { dg-additional-options "-msse2" { target x86_64-*-* i?86-*-* } } -inline void* my_alloc (__SIZE_TYPE__ bytes) {void *ptr; __builtin_posix_memalign (&ptr, bytes, 128);} +inline void* my_alloc (__SIZE_TYPE__ bytes) {void *ptr; __builtin_posix_memalign (&ptr, bytes, 128); return 0; } inline void my_free (void* memory) {__builtin_free (memory);} template diff --git a/gcc/testsuite/g++.dg/warn/Waddress-3.C b/gcc/testsuite/g++.dg/warn/Waddress-3.C index 13d7cd2c001..a97c7814ce5 100644 --- a/gcc/testsuite/g++.dg/warn/Waddress-3.C +++ b/gcc/testsuite/g++.dg/warn/Waddress-3.C @@ -1,6 +1,6 @@ // PR c++/65168 // { dg-do compile { target c++11 } } -// { dg-options -Waddress } +// { dg-options "-Waddress -Wno-return-type" } // We shouldn't warn in unevaluated context about the address of a reference // always being true. diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C b/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C index a71551fdf90..98f5c405165 100644 --- a/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C +++ b/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C @@ -48,7 +48,7 @@ void warn_for_NULL() NULL && NULL; // No warning: converting NULL to bool is OK } -int warn_for___null() +void warn_for___null() { int i = __null; // { dg-warning "" } converting __null to non-pointer type float z = __null; // { dg-warning "" } converting __null to non-pointer type diff --git a/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C b/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C index 92a87d1e76c..d5501fface5 100644 --- a/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C +++ b/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C @@ -34,6 +34,7 @@ void func1(long int a) { int x = 1; +int main() { int *p = &x; @@ -42,4 +43,6 @@ main() Foo::Compare(NULL, p); // { dg-warning "passing NULL to" } Foo::Compare(NULL, p); func1(NULL); // { dg-warning "passing NULL to" } + + return 0; } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-10.C b/gcc/testsuite/g++.dg/warn/Wparentheses-10.C index c30df090f5e..557db091ad0 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-10.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-10.C @@ -5,7 +5,7 @@ int foo (int); -int +void bar (int a, int b, int c) { foo (a & b ^ c); // { dg-warning "parentheses" "correct warning" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-11.C b/gcc/testsuite/g++.dg/warn/Wparentheses-11.C index 912c3b7ae76..6f0ecbe8bd8 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-11.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-11.C @@ -5,7 +5,7 @@ int foo (int); -int +void bar (int a, int b, int c) { foo (a + b & c); // { dg-warning "parentheses" "correct warning" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-12.C b/gcc/testsuite/g++.dg/warn/Wparentheses-12.C index b04529827d5..ca6407aea74 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-12.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-12.C @@ -7,7 +7,7 @@ int foo (int); int a, b, c; -int +void bar (void) { if (a) diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-25.C b/gcc/testsuite/g++.dg/warn/Wparentheses-25.C index d9951a4f46b..d3afa4ce784 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-25.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-25.C @@ -5,7 +5,7 @@ // C++ version of Wparentheses-11.c int foo (int); -int +void bar (int a, int b, int c) { foo (!a & b); /* { dg-warning "parentheses" "correct warning" } */ @@ -156,7 +156,7 @@ bar (int a, int b, int c) } -int +void baz (int a, int b, int c) { foo (!a & (b << c));/* { dg-warning "parentheses" "correct warning" } */ diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-6.C b/gcc/testsuite/g++.dg/warn/Wparentheses-6.C index 9963d822e05..d985d7e45d6 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-6.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-6.C @@ -5,7 +5,7 @@ int foo (int); -int +void bar (int a, int b, int c) { foo (a <= b <= c); // { dg-warning "comparison" "correct warning" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-7.C b/gcc/testsuite/g++.dg/warn/Wparentheses-7.C index 7d549c38c31..69d555b3dfb 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-7.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-7.C @@ -5,7 +5,7 @@ int foo (int); -int +void bar (int a, int b, int c) { foo (a + b << c); // { dg-warning "parentheses" "correct warning" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-8.C b/gcc/testsuite/g++.dg/warn/Wparentheses-8.C index ddb5e64b4ad..2089dce968c 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-8.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-8.C @@ -5,7 +5,7 @@ int foo (int); -int +void bar (int a, int b, int c) { foo (a && b || c); // { dg-warning "parentheses" "correct warning" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-9.C b/gcc/testsuite/g++.dg/warn/Wparentheses-9.C index bad6fb1c570..7c8f01d327b 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-9.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-9.C @@ -5,7 +5,7 @@ int foo (int); -int +void bar (int a, int b, int c) { foo (a & b | c); // { dg-warning "parentheses" "correct warning" } diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-5.C b/gcc/testsuite/g++.dg/warn/Wshadow-5.C index 7a90ec9c997..feb2bffcdc0 100644 --- a/gcc/testsuite/g++.dg/warn/Wshadow-5.C +++ b/gcc/testsuite/g++.dg/warn/Wshadow-5.C @@ -1,7 +1,7 @@ // Wshadows was giving warnings for nested function parameters in nested class // or structure that we didn't want. // { dg-do compile } -// { dg-options "-Wshadow" } +// { dg-options "-Wshadow -Wno-return-type" } // PR c++/41825 int f (int n) diff --git a/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C b/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C index 91b5c1b46d8..0cee96a8a98 100644 --- a/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C +++ b/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C @@ -69,7 +69,7 @@ void f(Int x) { assert(0 <= x and x <= D); } -int ff(void) { +void ff(void) { f(5); f(5); } @@ -78,7 +78,7 @@ template void g(void) { assert(0 <= D); } -int gg(void) { +void gg(void) { g(); } diff --git a/gcc/testsuite/g++.dg/warn/Wtype-limits-no.C b/gcc/testsuite/g++.dg/warn/Wtype-limits-no.C index 5040e2657ba..ad248d71808 100644 --- a/gcc/testsuite/g++.dg/warn/Wtype-limits-no.C +++ b/gcc/testsuite/g++.dg/warn/Wtype-limits-no.C @@ -69,7 +69,7 @@ void f(Int x) { assert(0 <= x and x <= D); // { dg-bogus "comparison is always true due to limited range of data type" } } -int ff(void) { +void ff(void) { f(5); f(5); } @@ -78,7 +78,7 @@ template void g(void) { assert(0 <= D); } -int gg(void) { +void gg(void) { g(); } diff --git a/gcc/testsuite/g++.dg/warn/Wtype-limits.C b/gcc/testsuite/g++.dg/warn/Wtype-limits.C index c345eff0b44..7919a42c834 100644 --- a/gcc/testsuite/g++.dg/warn/Wtype-limits.C +++ b/gcc/testsuite/g++.dg/warn/Wtype-limits.C @@ -69,7 +69,7 @@ void f(Int x) { assert(0 <= x and x <= D); } -int ff(void) { +void ff(void) { f(5); f(5); } @@ -78,7 +78,7 @@ template void g(void) { assert(0 <= D); } -int gg(void) { +void gg(void) { g(); } diff --git a/gcc/testsuite/g++.dg/warn/Wunused-local-typedefs.C b/gcc/testsuite/g++.dg/warn/Wunused-local-typedefs.C index 4fc8640ed7b..73f7ec79ce1 100644 --- a/gcc/testsuite/g++.dg/warn/Wunused-local-typedefs.C +++ b/gcc/testsuite/g++.dg/warn/Wunused-local-typedefs.C @@ -31,7 +31,7 @@ test0_tmpl(void) foo(2); } -int +void test0(void) { test0_tmpl(); diff --git a/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-5.C b/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-5.C index 185d2b5c4ee..4269beda28a 100644 --- a/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-5.C +++ b/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-5.C @@ -1,5 +1,5 @@ // PR c++/52718 -// { dg-options "-Wzero-as-null-pointer-constant" } +// { dg-options "-Wzero-as-null-pointer-constant -Wno-return-type" } struct foo { diff --git a/gcc/testsuite/g++.dg/warn/pmf1.C b/gcc/testsuite/g++.dg/warn/pmf1.C index 013c21b6db9..a63a00c33df 100644 --- a/gcc/testsuite/g++.dg/warn/pmf1.C +++ b/gcc/testsuite/g++.dg/warn/pmf1.C @@ -15,4 +15,5 @@ int a::f() const { int (a::* b)() const = &f; // { dg-error "&a::f" } + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/p13417.C b/gcc/testsuite/g++.old-deja/g++.benjamin/p13417.C index 132b13df277..e705f0dffb5 100644 --- a/gcc/testsuite/g++.old-deja/g++.benjamin/p13417.C +++ b/gcc/testsuite/g++.old-deja/g++.benjamin/p13417.C @@ -1,5 +1,5 @@ // { dg-do assemble } -// { dg-options "-Wno-deprecated" } +// { dg-options "-Wno-deprecated -Wno-return-type" } // prms-id: 13417 class Foo { diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash24.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash24.C index 42d0fabc238..e1e9d32c94f 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash24.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash24.C @@ -11,9 +11,12 @@ // array bounds, and then force the array to be allocated on the stack instead // of a register. +int main() { char i[1]; i[1] = 0; + + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.ext/constructor.C b/gcc/testsuite/g++.old-deja/g++.ext/constructor.C index a7995bbfe79..3dc15c52acd 100644 --- a/gcc/testsuite/g++.old-deja/g++.ext/constructor.C +++ b/gcc/testsuite/g++.old-deja/g++.ext/constructor.C @@ -9,6 +9,7 @@ struct Any { int i, j; +int main () { struct Any *ap = (struct Any *) __builtin_alloca (sizeof(struct Any)); diff --git a/gcc/testsuite/g++.old-deja/g++.ext/namedret1.C b/gcc/testsuite/g++.old-deja/g++.ext/namedret1.C index 29955fb525c..ae0391d1559 100644 --- a/gcc/testsuite/g++.old-deja/g++.ext/namedret1.C +++ b/gcc/testsuite/g++.old-deja/g++.ext/namedret1.C @@ -1,7 +1,7 @@ // { dg-do assemble } // { dg-options "-Wno-deprecated" } -int f(int x) return y(x) { } // { dg-error "" } +int f(int x) return y(x) { return 0; } // { dg-error "" } extern "C" void abort (); diff --git a/gcc/testsuite/g++.old-deja/g++.ext/namedret3.C b/gcc/testsuite/g++.old-deja/g++.ext/namedret3.C index 7a0e0d5943f..0caf6a31378 100644 --- a/gcc/testsuite/g++.old-deja/g++.ext/namedret3.C +++ b/gcc/testsuite/g++.old-deja/g++.ext/namedret3.C @@ -1,5 +1,5 @@ // { dg-do assemble } -// { dg-options "-Wno-deprecated" } +// { dg-options "-Wno-deprecated -Wno-return-type" } extern "C" void abort(); diff --git a/gcc/testsuite/g++.old-deja/g++.ext/return1.C b/gcc/testsuite/g++.old-deja/g++.ext/return1.C index f6bbc4da211..60d7c8abcf8 100644 --- a/gcc/testsuite/g++.old-deja/g++.ext/return1.C +++ b/gcc/testsuite/g++.old-deja/g++.ext/return1.C @@ -1,5 +1,5 @@ // { dg-do assemble } -// { dg-options "-Wno-deprecated" } +// { dg-options "-Wno-deprecated -Wno-return-type" } // Test that the named return value extension works when passed as a reference. // Origin: Jason Merrill diff --git a/gcc/testsuite/g++.old-deja/g++.jason/anon4.C b/gcc/testsuite/g++.old-deja/g++.jason/anon4.C index 588bf263c8d..47b87790119 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/anon4.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/anon4.C @@ -3,6 +3,7 @@ // PRMS Id: 5371 // Bug: g++ screws up the alignment of buff and dies. +int main() { union { @@ -11,4 +12,5 @@ main() }; void *p = buff; + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/enum6.C b/gcc/testsuite/g++.old-deja/g++.jason/enum6.C index c5bcec9ad7a..4894b55cdb3 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/enum6.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/enum6.C @@ -18,6 +18,7 @@ enum C { c1 = -1, c2 = 0x80000000 }; enum D { d1 = CHAR_MIN, d2 = CHAR_MAX }; enum E { e1 = CHAR_MIN, e2 = CHAR_MIN }; +int main() { return (sizeof (A) != 4 || sizeof (B) != 4 || sizeof (C) != 8 diff --git a/gcc/testsuite/g++.old-deja/g++.jason/lineno2.C b/gcc/testsuite/g++.old-deja/g++.jason/lineno2.C index 7f33176493c..a4f524acb70 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/lineno2.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/lineno2.C @@ -8,7 +8,9 @@ public: # 200 "lineno2.C" }; +int main() { - undef1(); // { dg-error "" "" { target *-*-* } 204 } + undef1(); // { dg-error "" "" { target *-*-* } 205 } + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/lineno3.C b/gcc/testsuite/g++.old-deja/g++.jason/lineno3.C index 997267e7244..8e305606b64 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/lineno3.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/lineno3.C @@ -7,7 +7,7 @@ template class A { public: # 200 "lineno3.C" - int foo () { undef1(); } // { dg-error "" "" { target *-*-* } 200 } + void foo () { undef1(); } // { dg-error "" "" { target *-*-* } 200 } // { dg-message "note" "note" { target *-*-* } 200 } }; diff --git a/gcc/testsuite/g++.old-deja/g++.jason/lineno4.C b/gcc/testsuite/g++.old-deja/g++.jason/lineno4.C index caa5bc216cd..703c897d12f 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/lineno4.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/lineno4.C @@ -7,7 +7,7 @@ template class A public: # 200 "lineno4.C" - int foo () { undef1(); } // { dg-error "" "" { target *-*-* } 200 } + void foo () { undef1(); } // { dg-error "" "" { target *-*-* } 200 } // { dg-message "note" "note" { target *-*-* } 200 } }; diff --git a/gcc/testsuite/g++.old-deja/g++.jason/new2.C b/gcc/testsuite/g++.old-deja/g++.jason/new2.C index 75d353da124..a2e000e19bf 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/new2.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/new2.C @@ -7,7 +7,9 @@ struct A { A() { i = 2; } }; +int main() { A *p = new A (); + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/new4.C b/gcc/testsuite/g++.old-deja/g++.jason/new4.C index 770a2a26f92..d09ca1453cc 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/new4.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/new4.C @@ -10,6 +10,7 @@ struct A { A* ap = new A (1); A* ap2 = new A[3]; +int main () { if (ap->i != 1 || ap2[0].i != 42 || ap2[1].i != 42 || ap2[2].i != 42) @@ -20,4 +21,6 @@ main () if (ap->i != 1 || ap2[0].i != 42 || ap2[1].i != 42 || ap2[2].i != 42) return 1; + + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/shadow1.C b/gcc/testsuite/g++.old-deja/g++.jason/shadow1.C index 941f80cfc00..fe3ec951b78 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/shadow1.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/shadow1.C @@ -10,7 +10,9 @@ private: void x::fun() { } +int main () { float foo; + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/tempcons.C b/gcc/testsuite/g++.old-deja/g++.jason/tempcons.C index a9974dbf779..d56eab51978 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/tempcons.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/tempcons.C @@ -4,5 +4,5 @@ template struct A { int i; - Blarg () : i(0) { } // { dg-error "" } + Blarg () : i(0) { return 0; } // { dg-error "" } }; diff --git a/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C b/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C index 427ef7f921d..8c02fc8f1d9 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C @@ -40,10 +40,13 @@ void* test(MMixin& anExample) return anExample.MixinFunc(1,A(0)).p; } +int main () { CExample c; if (test(c) != &c) return 1; + + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/builtin1.C b/gcc/testsuite/g++.old-deja/g++.law/builtin1.C index 67b71a83685..de228642250 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/builtin1.C +++ b/gcc/testsuite/g++.old-deja/g++.law/builtin1.C @@ -14,4 +14,6 @@ extern "C" int printf (const char *, ...); void* junk() { return __builtin_alloca(10); } -main() { printf ("PASS\n");} + +int +main() { printf ("PASS\n"); return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/enum9.C b/gcc/testsuite/g++.old-deja/g++.law/enum9.C index a1a551d6e55..4fdb7aaeff5 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/enum9.C +++ b/gcc/testsuite/g++.old-deja/g++.law/enum9.C @@ -15,6 +15,7 @@ enum E { A = 0x80000000, B = 0 }; + int main() { if (sizeof (E) != 4) diff --git a/gcc/testsuite/g++.old-deja/g++.law/except3.C b/gcc/testsuite/g++.old-deja/g++.law/except3.C index ec8bb100ee7..dc416eb3682 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/except3.C +++ b/gcc/testsuite/g++.old-deja/g++.law/except3.C @@ -34,6 +34,7 @@ void do_something(Vector& v) int i = v[v.size()+10]; } +int main() { Vector v(10); diff --git a/gcc/testsuite/g++.old-deja/g++.law/init6.C b/gcc/testsuite/g++.old-deja/g++.law/init6.C index 861b9252c95..65a07803070 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/init6.C +++ b/gcc/testsuite/g++.old-deja/g++.law/init6.C @@ -1,4 +1,5 @@ // { dg-do assemble } +// { dg-additional-options "-Wno-return-type" } // GROUPS passed initialization class Vector { double *v; diff --git a/gcc/testsuite/g++.old-deja/g++.law/profile1.C b/gcc/testsuite/g++.old-deja/g++.law/profile1.C index ecd3b834c76..66ef7766d04 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/profile1.C +++ b/gcc/testsuite/g++.old-deja/g++.law/profile1.C @@ -4,9 +4,12 @@ // { dg-options "-pg -static" { target hppa*-*-hpux* } } // GROUPS passed profiling #include + +int main() { printf ("PASS\n"); + return 0; } /* { dg-final { cleanup-profile-file } } */ diff --git a/gcc/testsuite/g++.old-deja/g++.law/shadow2.C b/gcc/testsuite/g++.old-deja/g++.law/shadow2.C index 46f9dfcc32f..64d967a01d5 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/shadow2.C +++ b/gcc/testsuite/g++.old-deja/g++.law/shadow2.C @@ -22,7 +22,9 @@ public: int f (int count) { return (count); } }; +int main () { Y y; + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/temps4.C b/gcc/testsuite/g++.old-deja/g++.law/temps4.C index 3f8c9ed2c7d..df930537e2e 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/temps4.C +++ b/gcc/testsuite/g++.old-deja/g++.law/temps4.C @@ -31,10 +31,13 @@ X foo() { return x; } +int main() { X x = foo(); if (did_it) abort (); else printf ("PASS\n"); + + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/bool2.C b/gcc/testsuite/g++.old-deja/g++.mike/bool2.C index 3d8bc3c03eb..32b3d8c0f78 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/bool2.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/bool2.C @@ -46,6 +46,8 @@ int i = true; bool b = true; bool c = (bool)(void (A::*)())0; bool d = 256; + +int main() { if (!d) return 1; if (!a) return 1; @@ -55,4 +57,6 @@ main() { if (!a2) return 1; if (!a3) return 1; if (!a5) return 1; + + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh1.C b/gcc/testsuite/g++.old-deja/g++.mike/eh1.C index 8105107f363..98191a20bc5 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh1.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh1.C @@ -24,6 +24,7 @@ struct Exception } } +int main (int argc, const char *argv[]) { if (argc != 2) diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh10.C b/gcc/testsuite/g++.old-deja/g++.mike/eh10.C index a38e2ebc770..32587d4c158 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh10.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh10.C @@ -16,6 +16,7 @@ void bar() { void ee(int *) { } +int main() { try { foo(); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh13.C b/gcc/testsuite/g++.old-deja/g++.mike/eh13.C index bac56865576..e2c7435c5ca 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh13.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh13.C @@ -3,4 +3,4 @@ #include -main() { } +int main() { return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh16.C b/gcc/testsuite/g++.old-deja/g++.mike/eh16.C index 73beac0a5bd..7a985908f3b 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh16.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh16.C @@ -16,6 +16,7 @@ struct B { } }; +int main() { try { B b; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh17.C b/gcc/testsuite/g++.old-deja/g++.mike/eh17.C index 5b066c9c36b..2443d568024 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh17.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh17.C @@ -15,6 +15,7 @@ struct B : public A { } }; +int main() { try { B b; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh2.C b/gcc/testsuite/g++.old-deja/g++.mike/eh2.C index 0a08790fe03..862bd6e7598 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh2.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh2.C @@ -63,12 +63,10 @@ f(Vector& v) { } } +int main() { Vector v(10); f( v ); return 1; } - - - diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh23.C b/gcc/testsuite/g++.old-deja/g++.mike/eh23.C index da2ac0ef39d..64733371b51 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh23.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh23.C @@ -36,6 +36,7 @@ void my_terminate() { exit (0); // double faults should call terminate } +int main() { std::set_terminate (my_terminate); try { diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh24.C b/gcc/testsuite/g++.old-deja/g++.mike/eh24.C index 829819b396d..89b27c88fd7 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh24.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh24.C @@ -15,6 +15,7 @@ struct A { } }; +int main() { try { try { diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh25.C b/gcc/testsuite/g++.old-deja/g++.mike/eh25.C index 0ac61981b97..6516494dd44 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh25.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh25.C @@ -22,6 +22,7 @@ struct A { } }; +int main() { try { try { diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh26.C b/gcc/testsuite/g++.old-deja/g++.mike/eh26.C index d0d65da311a..6d82a4e73a6 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh26.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh26.C @@ -3,6 +3,7 @@ class MyExceptionHandler { }; +int main() { try { throw MyExceptionHandler(); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh27.C b/gcc/testsuite/g++.old-deja/g++.mike/eh27.C index 8be08da8c26..dcfb5e7a093 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh27.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh27.C @@ -5,6 +5,7 @@ class MyExceptionHandler { }; +int main() { try { throw MyExceptionHandler(); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh28.C b/gcc/testsuite/g++.old-deja/g++.mike/eh28.C index 57cab1178a4..47cd3861ca1 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh28.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh28.C @@ -8,6 +8,7 @@ int fail = 1; class X { public: virtual void p() { } }; class Y : public X { public: virtual void p() { fail = 0; } }; +int main() { try { Y y; throw y; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh29.C b/gcc/testsuite/g++.old-deja/g++.mike/eh29.C index 892e959647e..bcb4cea2874 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh29.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh29.C @@ -17,6 +17,7 @@ public: } }; +int main() { try { A a[5]; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh30.C b/gcc/testsuite/g++.old-deja/g++.mike/eh30.C index 8da682c5341..848809245c1 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh30.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh30.C @@ -1,4 +1,5 @@ // { dg-do assemble { target native } } // { dg-options "-fexceptions -fPIC -S" } +int main() { throw 1; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh31.C b/gcc/testsuite/g++.old-deja/g++.mike/eh31.C index 150d66b98a6..d7e84dd71e0 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh31.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh31.C @@ -11,6 +11,7 @@ public: }; +int main() { try { throw Foo(); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh35.C b/gcc/testsuite/g++.old-deja/g++.mike/eh35.C index adf852a64a3..9ea5a662d56 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh35.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh35.C @@ -1,6 +1,7 @@ // { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } +int main() { try { throw 'a'; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh36.C b/gcc/testsuite/g++.old-deja/g++.mike/eh36.C index d6b4788cbfa..ba9e814ca3d 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh36.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh36.C @@ -18,6 +18,7 @@ public: } } d(42); +int main() { try { throw &d; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh37.C b/gcc/testsuite/g++.old-deja/g++.mike/eh37.C index a98b5df997f..63774119dd5 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh37.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh37.C @@ -10,6 +10,7 @@ public: } } b(42); +int main() { try { throw &b; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh38.C b/gcc/testsuite/g++.old-deja/g++.mike/eh38.C index 5a568798259..6482b900818 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh38.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh38.C @@ -10,6 +10,7 @@ public: } } b(42); +int main() { try { throw &b; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh39.C b/gcc/testsuite/g++.old-deja/g++.mike/eh39.C index e4bfff8d17a..8f8a84481e6 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh39.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh39.C @@ -18,6 +18,7 @@ D::D() try : B() { throw; } +int main() { try { D d; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh40.C b/gcc/testsuite/g++.old-deja/g++.mike/eh40.C index e42b419747a..f08836064c4 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh40.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh40.C @@ -19,6 +19,7 @@ public: } }; +int main() { try { D d; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh47.C b/gcc/testsuite/g++.old-deja/g++.mike/eh47.C index 10eb8a8970f..36d3b9db329 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh47.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh47.C @@ -8,6 +8,7 @@ void myterm() { exit (0); } +int main() { try { throw ""; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh50.C b/gcc/testsuite/g++.old-deja/g++.mike/eh50.C index 0ebaab41fa6..028a2de0c23 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh50.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh50.C @@ -10,6 +10,7 @@ void my_unexpected() { template void foo(T) throw (int) { throw "Hi"; } // { dg-warning "deprecated" "" { target c++11 } } +int main() { std::set_unexpected (my_unexpected); try { diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh51.C b/gcc/testsuite/g++.old-deja/g++.mike/eh51.C index 7d3cd413ee7..428635b175d 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh51.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh51.C @@ -10,6 +10,7 @@ void my_unexpected() { template void foo(T) throw (T) { throw "Hi"; } // { dg-warning "deprecated" "" { target c++11 } } +int main() { std::set_unexpected (my_unexpected); try { diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh7.C b/gcc/testsuite/g++.old-deja/g++.mike/eh7.C index f431fb96d86..6a0502c484e 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh7.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh7.C @@ -1,6 +1,7 @@ // { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } +int main() { if (0) throw 1 | 2; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh8.C b/gcc/testsuite/g++.old-deja/g++.mike/eh8.C index 8e01da0b51b..be69abcf855 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh8.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh8.C @@ -5,6 +5,7 @@ extern "C" int printf(const char *, ...); int i; +int main() { try { try { diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh9.C b/gcc/testsuite/g++.old-deja/g++.mike/eh9.C index 633642faa95..a84bc27df49 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh9.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh9.C @@ -1,4 +1,5 @@ // { dg-do run { xfail sparc64-*-elf arm-*-pe } } // { dg-options "-fexceptions" } +int main() throw () { } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/mangle1.C b/gcc/testsuite/g++.old-deja/g++.mike/mangle1.C index de5e96588b3..3053af9dd58 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/mangle1.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/mangle1.C @@ -22,6 +22,7 @@ void f3() { } #endif +int main() { f.bar(foo::red); } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5958.C b/gcc/testsuite/g++.old-deja/g++.mike/p5958.C index 666a4494509..ffcb13401da 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p5958.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p5958.C @@ -4,6 +4,7 @@ class A { }; +int main() { int i = 1; if (1 not_eq 1) diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p6004.C b/gcc/testsuite/g++.old-deja/g++.mike/p6004.C index 2b262bdb047..d1db7e006fe 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p6004.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p6004.C @@ -16,6 +16,7 @@ int bar3() { return 43; } int A::foo() { return 42; } +int main() { return A::foo() - 42; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p700.C b/gcc/testsuite/g++.old-deja/g++.mike/p700.C index 62247791775..e4537c72868 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p700.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p700.C @@ -1,5 +1,5 @@ // { dg-do assemble } -// { dg-options "-Wno-deprecated -Wno-register -Wno-builtin-declaration-mismatch" } +// { dg-options "-Wno-deprecated -Wno-register -Wno-builtin-declaration-mismatch -Wno-return-type" } // { dg-error "limited range of data type" "16-bit target" { target xstormy16-*-* } 0 } // prms-id: 700 @@ -2111,6 +2111,7 @@ char mystrcmp(String30 s, String30 t) +int main() { Proc0(); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7912.C b/gcc/testsuite/g++.old-deja/g++.mike/p7912.C index e5584ec4cd9..fe381e2d0e6 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7912.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p7912.C @@ -12,6 +12,7 @@ public: }; +int main() { try { diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p811.C b/gcc/testsuite/g++.old-deja/g++.mike/p811.C index 2ca04abdcba..bebfe6b7e20 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p811.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p811.C @@ -535,6 +535,7 @@ X::stringify2() // { dg-error "no declaration matches" } return "stringify2"; } +int main() { X x; @@ -547,4 +548,6 @@ main() cout << "y\n"; cout << y.stringify() << '\n'; cout << y.stringify2() << '\n'; + + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/virt4.C b/gcc/testsuite/g++.old-deja/g++.mike/virt4.C index 2d8b042632a..b6e4411ff65 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/virt4.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/virt4.C @@ -22,7 +22,9 @@ public: void foo() { D1::foo(); D2::foo(); } }; +int main() { D1_2 h; h.foo(); + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/nameret1.C b/gcc/testsuite/g++.old-deja/g++.oliva/nameret1.C index b32deedd4ee..8e5eccc293a 100644 --- a/gcc/testsuite/g++.old-deja/g++.oliva/nameret1.C +++ b/gcc/testsuite/g++.old-deja/g++.oliva/nameret1.C @@ -1,5 +1,5 @@ // { dg-do assemble } -// { dg-options "-Wno-deprecated" } +// { dg-options "-Wno-deprecated -Wno-return-type" } // Copyright (C) 1999, 2000, 2002 Free Software Foundation // by Alexandre Oliva diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/nameret2.C b/gcc/testsuite/g++.old-deja/g++.oliva/nameret2.C index e0dfb7e129c..5f86b1c8417 100644 --- a/gcc/testsuite/g++.old-deja/g++.oliva/nameret2.C +++ b/gcc/testsuite/g++.old-deja/g++.oliva/nameret2.C @@ -1,5 +1,5 @@ // { dg-do assemble } -// { dg-options "-O1 -Wno-deprecated" } +// { dg-options "-O1 -Wno-deprecated -Wno-return-type" } // Copyright (C) 1999, 2000, 2002 Free Software Foundation // by Alexandre Oliva diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl1.C b/gcc/testsuite/g++.old-deja/g++.other/decl1.C index 07bcc914521..6262bf307df 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/decl1.C +++ b/gcc/testsuite/g++.old-deja/g++.other/decl1.C @@ -6,4 +6,5 @@ int foo(int); int bar() { int baz(int(foo(0))); int foo = baz; + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.other/expr1.C b/gcc/testsuite/g++.old-deja/g++.other/expr1.C index 831876d01cb..415f0f19ef2 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/expr1.C +++ b/gcc/testsuite/g++.old-deja/g++.other/expr1.C @@ -3,9 +3,10 @@ // Simplified from bug report by Trevor Taylor struct T { - int operator()(int) { } // { dg-message "operator|candidate expects" } + int operator()(int) { return 0; } // { dg-message "operator|candidate expects" } }; int main() { T()(); // { dg-error "match" } no such operator + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline8.C b/gcc/testsuite/g++.old-deja/g++.other/inline8.C index a46dc382a7d..c12a8f74a90 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/inline8.C +++ b/gcc/testsuite/g++.old-deja/g++.other/inline8.C @@ -62,8 +62,10 @@ bool operator<(const NAMES_ITEM& n1, const NAMES_ITEM& n2) lookup_t lookup; NAMES_ITEM item ("one"); + +int main() { lookup.insert(pair(item,0)); + return 0; } - diff --git a/gcc/testsuite/g++.old-deja/g++.other/loop1.C b/gcc/testsuite/g++.old-deja/g++.other/loop1.C index 168734c545b..45b2acc3ef6 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/loop1.C +++ b/gcc/testsuite/g++.old-deja/g++.other/loop1.C @@ -24,6 +24,7 @@ bool test () return true; } +int main () { f (test); diff --git a/gcc/testsuite/g++.old-deja/g++.other/syntax1.C b/gcc/testsuite/g++.old-deja/g++.other/syntax1.C index f1d3a86549c..d219048bb68 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/syntax1.C +++ b/gcc/testsuite/g++.old-deja/g++.other/syntax1.C @@ -11,7 +11,9 @@ void AAA::fff() {} AAA aaa; +int main () { aaa.fff(); + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/repo3.C b/gcc/testsuite/g++.old-deja/g++.pt/repo3.C index 53baf29f349..2f62139660e 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/repo3.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/repo3.C @@ -29,9 +29,11 @@ struct D : public B, public C { }; +int main () { D x; + return 0; } // { dg-final { cleanup-repo-files } } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C index 204a143d619..2fe151cea7d 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C @@ -1,5 +1,6 @@ // { dg-do assemble } // { dg-options "-Wno-deprecated" } +// { dg-additional-options "-Wno-return-type" } /* bug.cc */ /* simple program to demonstrate the bug with named return values in gcc */ @@ -39,4 +40,5 @@ int main() std::cout << x << std::endl; y = x + test(2); std::cout << y << std::endl; + return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C index ecdb6bed788..47cf5b88f04 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C @@ -8,11 +8,13 @@ test_swap(int& x, int& y) throw() y = tmp; } +int main() { int i = 5; int j = 7; test_swap(i, j); + return 0; } /* { dg-final { cleanup-coverage-files } } */ diff --git a/gcc/testsuite/gcc.dg/pr44545.c b/gcc/testsuite/gcc.dg/pr44545.c index 51983ef76b9..8058261f850 100644 --- a/gcc/testsuite/gcc.dg/pr44545.c +++ b/gcc/testsuite/gcc.dg/pr44545.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fnon-call-exceptions -ftrapv -fexceptions" } */ -int +void DrawChunk(int *tabSize, int x) { const int numEnds = 10; diff --git a/gcc/testsuite/obj-c++.dg/comp-types-8.mm b/gcc/testsuite/obj-c++.dg/comp-types-8.mm index 490f4ff1938..6db76bb20f3 100644 --- a/gcc/testsuite/obj-c++.dg/comp-types-8.mm +++ b/gcc/testsuite/obj-c++.dg/comp-types-8.mm @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ /* We used to ICE because we removed the cast to List_linked* in -[ListIndex_linked next]. */ diff --git a/gcc/testsuite/obj-c++.dg/demangle-3.mm b/gcc/testsuite/obj-c++.dg/demangle-3.mm index 01e6c618e5e..afb83d75bfe 100644 --- a/gcc/testsuite/obj-c++.dg/demangle-3.mm +++ b/gcc/testsuite/obj-c++.dg/demangle-3.mm @@ -1,5 +1,6 @@ /* Test demangling an Objective-C method in error messages. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ #include diff --git a/gcc/testsuite/obj-c++.dg/super-class-1.mm b/gcc/testsuite/obj-c++.dg/super-class-1.mm index f8cccb3d4c8..ad14a58c29a 100644 --- a/gcc/testsuite/obj-c++.dg/super-class-1.mm +++ b/gcc/testsuite/obj-c++.dg/super-class-1.mm @@ -1,6 +1,7 @@ /* Test calling super from within a category method. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-return-type" } */ #include -- 2.30.2