diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-18 09:01:21 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-18 09:01:21 +0000 |
commit | 3cefe7ff3b59688a672c937663751c611bfb5ac7 (patch) | |
tree | 6bf320b2bf650044576c1d8773573d6b783c181e /gcc/testsuite | |
parent | 27ed7650debf12b87a76091b7a80998e234ba66e (diff) | |
download | gcc-3cefe7ff3b59688a672c937663751c611bfb5ac7.tar.gz |
2011-07-18 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 176387 using svnmerge.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@176388 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
73 files changed, 529 insertions, 108 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a592c253d83..9eb36a76045 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,113 @@ +2011-07-17 Tobias Burnus <burnus@net-b.de> + Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/34657 + * gfortran.dg/generic_17.f90: Fix testcase. + * gfortran.dg/interface_3.f90: Add dg-error. + * gfortran.dg/use_14.f90: New. + * gfortran.dg/use_15.f90: New. + +2011-07-17 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/pointer_controlled.adb: New test. + +2011-07-17 Tobias Burnus <burnus@net-b.de> + + PR fortran/49624 + * gfortran.dg/pointer_remapping_7.f90: New. + +2011-07-16 Jason Merrill <jason@redhat.com> + + * lib/prune.exp (prune_gcc_output): Prune "In substitution" too. + +2011-07-16 Nathan Froyd <froydnj@codesourcery.com> + Jason Merrill <jason@redhat.com> + + PR c++/45329 + PR c++/48934 + * g++.dg/cpp0x/decltype29.C: Adjust. + * g++.dg/cpp0x/error4.C: Adjust. + * g++.dg/cpp0x/sfinae26.C: Adjust. + * g++.dg/cpp0x/variadic105.C: Adjust. + * g++.dg/template/deduce3.C: Adjust. + * g++.dg/template/error45.C: Adjust. + * g++.dg/template/ptrmem2.C: Adjust. + * g++.dg/template/sfinae2.C: Adjust. + * g++.old-deja/g++.pt/crash60.C: Adjust. + * g++.old-deja/g++.pt/unify6.C: Adjust. + * g++.dg/cpp0x/lambda/lambda-ice2.C: Adjust. + * g++.dg/cpp0x/nullptr15.C: Adjust. + * g++.dg/cpp0x/pr31431-2.C: Adjust. + * g++.dg/cpp0x/pr31431.C: Adjust. + * g++.dg/cpp0x/pr31434.C: Adjust. + * g++.dg/cpp0x/sfinae11.C: Adjust + * g++.dg/cpp0x/temp_default2.C: Adjust. + * g++.dg/cpp0x/trailing4.C: Adjust. + * g++.dg/cpp0x/variadic-ex3.C: Adjust. + * g++.dg/cpp0x/variadic-ex4.C: Adjust. + * g++.dg/cpp0x/variadic105.C: Adjust. + * g++.dg/cpp0x/vt-37737-2.C: Adjust. + * g++.dg/ext/vla2.C: Adjust. + * g++.dg/other/ptrmem10.C: Adjust. + * g++.dg/other/ptrmem11.C: Adjust. + * g++.dg/overload/unknown1.C: Adjust. + * g++.dg/template/conv11.C: Adjust. + * g++.dg/template/dependent-expr5.C: Adjust. + * g++.dg/template/friend.C: Adjust. + * g++.dg/template/incomplete2.C: Adjust. + * g++.dg/template/local4.C: Adjust. + * g++.dg/template/local6.C: Adjust. + * g++.dg/template/operator9.C: Adjust. + * g++.dg/template/ttp25.C: Adjust. + * g++.dg/template/unify10.C: Adjust. + * g++.dg/template/unify11.C: Adjust. + * g++.dg/template/unify6.C: Adjust. + * g++.dg/template/unify9.C: Adjust. + * g++.dg/template/varmod1.C: Adjust. + * g++.old-deja/g++.brendan/crash56.C: Adjust. + * g++.old-deja/g++.pt/crash28.C: Adjust. + * g++.old-deja/g++.pt/explicit41.C: Adjust. + * g++.old-deja/g++.pt/explicit77.C: Adjust. + * g++.old-deja/g++.pt/expr2.C: Adjust. + * g++.old-deja/g++.pt/ptrmem6.C: Adjust. + * g++.old-deja/g++.pt/spec5.C: Adjust. + * g++.old-deja/g++.pt/spec6.C: Adjust. + * g++.old-deja/g++.pt/unify4.C: Adjust. + * g++.old-deja/g++.pt/unify8.C: Adjust. + * g++.old-deja/g++.robertl/eb98.C: Adjust. + * g++.dg/overload/template5.C: New testcase. + * g++.dg/template/overload12.C: New testcase. + +2011-07-11 Tobias Burnus <burnus@net-b.de> + + * gfortran.dg/coarray_14.f90: Remove dg-error "sorry not implemented". + * gfortran.dg/coarray_7.f90: Ditto. + * gfortran.dg/coarray/scalar_alloc_1.f90: New. + * gfortran.dg/coarray/scalar_alloc_2.f90: New. + +2011-07-16 Bernd Schmidt <bernds@codesourcery.com> + + * gcc.c-torture/execute/ieee/mul-subnormal-single-1.x: Add tic6x-*-* + case. + * gcc.c-torture/execute/ieee/20000320-1.x: Likewise. + * gcc.c-torture/execute/ieee/hugeval.x: Likewise. + * gcc.c-torture/execute/ieee/mzero2.c: Comment out the divide tests for + C67X. + * gcc.c-torture/execute/ieee/pr29302.x: New file. + * gcc.dg/torture/type-generic-1.c: Add -DUNSAFE for tic6x-*-*. + * gcc.dg/torture/builtin-math-7.c: Add a comment. + +2011-07-15 Jason Merrill <jason@redhat.com> + + PR testsuite/49741 + * lib/g++.exp (${tool}_option_help, ${tool}_option_proc): Restore. + Use --extra_opts instead of --additional_options. + +2011-07-15 Jakub Jelinek <jakub@redhat.com> + + PR testsuite/49753 + * g++.dg/torture/pr49309.C: Remove. + 2011-07-15 Bernd Schmidt <bernds@codesourcery.com> * gcc.target/tic6x/weak-call.c: New test. diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype29.C b/gcc/testsuite/g++.dg/cpp0x/decltype29.C index 2bb79d07e78..70fe4412dcb 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype29.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype29.C @@ -13,7 +13,7 @@ decltype (ft<F> (F())) ft() {} // { dg-error "depth" } int main() { - ft<struct a*, 0>(); // { dg-error "no match" } + ft<struct a*, 0>(); // { dg-error "no match|wrong number" } } // { dg-prune-output "note" } diff --git a/gcc/testsuite/g++.dg/cpp0x/error4.C b/gcc/testsuite/g++.dg/cpp0x/error4.C index 29a1cddab16..064c2f2f620 100644 --- a/gcc/testsuite/g++.dg/cpp0x/error4.C +++ b/gcc/testsuite/g++.dg/cpp0x/error4.C @@ -10,7 +10,7 @@ struct S { static U get(const volatile T&); template<typename U> - static decltype(*declval<U>()) get(...); + static decltype(*declval<U>()) get(...); // { dg-error "operator*" } typedef decltype(get<T>(declval<T>())) type; // { dg-error "no match" } }; diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C index 352137aad24..8d7d093dc40 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C @@ -9,8 +9,9 @@ decltype(F()) run(F f) // { dg-message "note" } int main() { - auto l = []() { return 5; }; + auto l = []() { return 5; }; // { dg-error "lambda closure type" } run(l); // { dg-error "no match" } // { dg-message "candidate" "candidate note" { target *-*-* } 14 } + // { dg-error "use of deleted function" "candidate explanation" { target *-*-* } 5 } } diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr15.C b/gcc/testsuite/g++.dg/cpp0x/nullptr15.C index e02fd5592eb..af661ecc3af 100644 --- a/gcc/testsuite/g++.dg/cpp0x/nullptr15.C +++ b/gcc/testsuite/g++.dg/cpp0x/nullptr15.C @@ -17,10 +17,10 @@ void test_g() // Deduction to nullptr_t, no deduction to pointer type // g(nullptr); // { dg-error "no matching function for call to " } - // { dg-message "candidate" "candidate note" { target *-*-* } 19 } + // { dg-message "(candidate|mismatched types)" "candidate note" { target *-*-* } 19 } type_equal<float*>(g((float*)nullptr)); decltype(nullptr) mynull = 0; g(mynull); // { dg-error "no matching function for call to " } - // { dg-message "candidate" "candidate note" { target *-*-* } 23 } + // { dg-message "(candidate|mismatched types)" "candidate note" { target *-*-* } 23 } type_equal<float*>(g((float*)mynull)); } diff --git a/gcc/testsuite/g++.dg/cpp0x/pr31431-2.C b/gcc/testsuite/g++.dg/cpp0x/pr31431-2.C index 15efbc5d359..076493938a8 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr31431-2.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr31431-2.C @@ -4,5 +4,5 @@ template<typename, typename..., typename> void foo(); // { dg-message "note" } void bar() { foo<int>(); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 6 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 6 } } diff --git a/gcc/testsuite/g++.dg/cpp0x/pr31431.C b/gcc/testsuite/g++.dg/cpp0x/pr31431.C index 36f341f3d02..afd32371574 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr31431.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr31431.C @@ -4,5 +4,5 @@ template<typename..., typename> void foo(); // { dg-message "note" } void bar() { foo<int>(); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 6 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 6 } } diff --git a/gcc/testsuite/g++.dg/cpp0x/pr31434.C b/gcc/testsuite/g++.dg/cpp0x/pr31434.C index 97ad079ab0b..54786167c35 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr31434.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr31434.C @@ -8,5 +8,5 @@ template<typename... T> int foo(const T&) // { dg-error "not expanded with|T" } void bar() { foo(0); // { dg-error "no matching" } - // { dg-message "candidate" "candidate note" { target *-*-* } 10 } + // { dg-message "(candidate|cannot convert)" "candidate note" { target *-*-* } 10 } } diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae11.C b/gcc/testsuite/g++.dg/cpp0x/sfinae11.C index 117b08bb623..e62c08984e7 100644 --- a/gcc/testsuite/g++.dg/cpp0x/sfinae11.C +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae11.C @@ -51,6 +51,6 @@ int main() // static_assert( noexcept( f3(y) ), "shall be ill-formed(OK)." ); noexcept( f1(z) ); // { dg-message "required" } - static_assert( noexcept( f2(z) ), "shall be ill-formed." ); // { dg-error "no match" } + static_assert( noexcept( f2(z) ), "shall be ill-formed." ); // { dg-error "no match|could not convert" } noexcept( f3(z) ); // { dg-message "required" } } diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae26.C b/gcc/testsuite/g++.dg/cpp0x/sfinae26.C index 5b8cdd9f545..42b48eb5a6b 100644 --- a/gcc/testsuite/g++.dg/cpp0x/sfinae26.C +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae26.C @@ -32,7 +32,7 @@ struct S { template<class... U, typename enable_if<and_<is_same<T, U>...>::value>::type*& = enabler > - S(U...){} // # + S(U...){} // { dg-error "no type named 'type'" } }; S<bool> s(0); // { dg-error "no match" } diff --git a/gcc/testsuite/g++.dg/cpp0x/temp_default2.C b/gcc/testsuite/g++.dg/cpp0x/temp_default2.C index fa2bb6aed86..dab1650e448 100644 --- a/gcc/testsuite/g++.dg/cpp0x/temp_default2.C +++ b/gcc/testsuite/g++.dg/cpp0x/temp_default2.C @@ -8,7 +8,7 @@ void g() f(1, 'c'); // f<int,char>(1,'c') f(1); // f<int,double>(1,0) f(); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 10 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 10 } f<int>(); // f<int,double>(0,0) f<int,char>(); // f<int,char>(0,0) } diff --git a/gcc/testsuite/g++.dg/cpp0x/trailing4.C b/gcc/testsuite/g++.dg/cpp0x/trailing4.C index d67b3b61151..8d4baa97e5d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/trailing4.C +++ b/gcc/testsuite/g++.dg/cpp0x/trailing4.C @@ -8,5 +8,5 @@ auto f(T,U) -> decltype(T() + U()) template<class T> void g(T){} // { dg-message "note" } int main() { g(f); } // { dg-error "no matching function" } -// { dg-message "candidate" "candidate note" { target *-*-* } 10 } +// { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 10 } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-ex3.C b/gcc/testsuite/g++.dg/cpp0x/variadic-ex3.C index bd973055d06..018eaa3ed8b 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic-ex3.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-ex3.C @@ -4,8 +4,8 @@ void g() { int i = f<int>(5.6); int j = f(5.6); // { dg-error "no matching" } - // { dg-message "candidate" "candidate note" { target *-*-* } 6 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 6 } f<void>(f<int, bool>); f<void>(f<int>); // { dg-error "no matching" } - // { dg-message "candidate" "candidate note" { target *-*-* } 9 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 9 } } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-ex4.C b/gcc/testsuite/g++.dg/cpp0x/variadic-ex4.C index 5bf211696a3..0a777c4853b 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic-ex4.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-ex4.C @@ -8,6 +8,6 @@ void g() f<int>("aa",3.0); // Y is deduced to be char*, and // Z is deduced to be double f("aa",3.0); // { dg-error "no matching" } - // { dg-message "candidate" "candidate note" { target *-*-* } 10 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 10 } f2<char, short, int, long>(); // okay } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic105.C b/gcc/testsuite/g++.dg/cpp0x/variadic105.C index 24d7e15be2f..66387b23c47 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic105.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic105.C @@ -21,4 +21,5 @@ struct call_sum { int main() { // This shouldn't be an error; this is bug 35722. reverse<call_sum>(1,2); // { dg-bogus "no match" "" { xfail *-*-* } } + // { dg-bogus "sorry, unimplemented" "candidate explanation" { xfail *-*-* } 6 } } diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C b/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C index 2ff7e5b0b51..5514259ec3f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C +++ b/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C @@ -4,7 +4,7 @@ template<class U, class... T> void f() // { dg-message "note" } { f<T...>(); // { dg-error "no matching" } - // { dg-message "candidate" "candidate note" { target *-*-* } 6 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 6 } } template<> diff --git a/gcc/testsuite/g++.dg/ext/vla2.C b/gcc/testsuite/g++.dg/ext/vla2.C index f6a9debca98..3e83c8b3de9 100644 --- a/gcc/testsuite/g++.dg/ext/vla2.C +++ b/gcc/testsuite/g++.dg/ext/vla2.C @@ -15,5 +15,5 @@ void bar(int i) char d[i] ; begin(d); // { dg-error "no matching function" "" } - // { dg-message "candidate" "candidate note" { target *-*-* } 17 } + // { dg-message "(candidate|valid template argument)" "candidate note" { target *-*-* } 17 } } diff --git a/gcc/testsuite/g++.dg/other/ptrmem10.C b/gcc/testsuite/g++.dg/other/ptrmem10.C index bc386ed56be..a17df7fb362 100644 --- a/gcc/testsuite/g++.dg/other/ptrmem10.C +++ b/gcc/testsuite/g++.dg/other/ptrmem10.C @@ -13,7 +13,7 @@ template <class C> static void bar(C *c, void (C::*m) ()) { - foo<C,m>((void *)c);// { dg-error "(not a valid template arg|pointer-to-member|no matching fun)" } + foo<C,m>((void *)c);// { dg-error "(not a valid template arg|pointer-to-member|no matching fun|could not convert)" } // { dg-message "candidate" "candidate note" { target *-*-* } 16 } } diff --git a/gcc/testsuite/g++.dg/other/ptrmem11.C b/gcc/testsuite/g++.dg/other/ptrmem11.C index 119cbb078a2..e73164eef26 100644 --- a/gcc/testsuite/g++.dg/other/ptrmem11.C +++ b/gcc/testsuite/g++.dg/other/ptrmem11.C @@ -14,7 +14,7 @@ template <typename T> int bar(int T::* p) { - return foo<p>(0);// { dg-error "(not a valid template arg|no matching func|pointer-to-member)" } + return foo<p>(0);// { dg-error "(not a valid template arg|no matching func|pointer-to-member|could not convert)" } // { dg-message "candidate" "candidate note" { target *-*-* } 17 } } diff --git a/gcc/testsuite/g++.dg/overload/template5.C b/gcc/testsuite/g++.dg/overload/template5.C new file mode 100644 index 00000000000..b1dc65ebe18 --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/template5.C @@ -0,0 +1,15 @@ +// { dg-do compile } + +template<typename T> +int low(T a, T b, T c) { return a + b + c; } // { dg-message "template" } + +template<typename T> +int high(T a, T b, T c) { return a + b + c; } // { dg-message "template" } + +int test (void) +{ + low (5, 6); // { dg-error "no matching function" } + // { dg-message "(candidate|3 arguments, 2 provided)" "" { target *-*-* } 11 } + high (5, 6, 7, 8); // { dg-error "no matching function" } + // { dg-message "(candidate|3 arguments, 4 provided)" "" { target *-*-* } 13 } +} diff --git a/gcc/testsuite/g++.dg/overload/unknown1.C b/gcc/testsuite/g++.dg/overload/unknown1.C index 935f8d4963d..128c4344fed 100644 --- a/gcc/testsuite/g++.dg/overload/unknown1.C +++ b/gcc/testsuite/g++.dg/overload/unknown1.C @@ -6,5 +6,5 @@ template <typename T> void bar(T f); // { dg-message "note" } void baz() { bar(foo); // { dg-error "<unresolved overloaded function type>" } - // { dg-message "candidate" "candidate note" { target *-*-* } 8 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 8 } } diff --git a/gcc/testsuite/g++.dg/template/conv11.C b/gcc/testsuite/g++.dg/template/conv11.C index 57d06af3ee7..f08e756a3ee 100644 --- a/gcc/testsuite/g++.dg/template/conv11.C +++ b/gcc/testsuite/g++.dg/template/conv11.C @@ -7,5 +7,5 @@ struct A int main() { A().operator int(); // { dg-error "operator int" } - // { dg-message "candidate" "candidate note" { target *-*-* } 9 } + // { dg-message "(candidate|mismatched types)" "candidate note" { target *-*-* } 9 } } diff --git a/gcc/testsuite/g++.dg/template/deduce3.C b/gcc/testsuite/g++.dg/template/deduce3.C index e8a1d4e2b51..c5d6e00daf7 100644 --- a/gcc/testsuite/g++.dg/template/deduce3.C +++ b/gcc/testsuite/g++.dg/template/deduce3.C @@ -4,8 +4,8 @@ void f(int, T (*)() = 0); // { dg-message "note" } void g() { typedef int A[2]; f<A>(0); // { dg-error "" } - // { dg-message "candidate" "candidate note" { target *-*-* } 6 } + // { dg-error "returning an array" "candidate explanation" { target *-*-* } 2 } typedef void F(); f<F>(0); // { dg-error "" } - // { dg-message "candidate" "candidate note" { target *-*-* } 9 } + // { dg-error "returning a function" "candidate explanation" { target *-*-* } 2 } } diff --git a/gcc/testsuite/g++.dg/template/dependent-expr5.C b/gcc/testsuite/g++.dg/template/dependent-expr5.C index 1e850cd54e5..af0dfb912a2 100644 --- a/gcc/testsuite/g++.dg/template/dependent-expr5.C +++ b/gcc/testsuite/g++.dg/template/dependent-expr5.C @@ -40,12 +40,12 @@ struct foo { bind (&bar::baikt); bind (&barf); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 42 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 42 } bind (&foo::barf); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 44 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 44 } bindm (&barf); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 47 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 47 } bindm (&foo::barf); bindn (&barf); @@ -53,15 +53,15 @@ struct foo { bindb (&barf); bindb (&foo::barf); // { dg-error "ambiguous" } - // { dg-message "candidate" "candidate note" { target *-*-* } 55 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 55 } bind (&bark); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 58 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 58 } bind (&bar::bark); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 60 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 60 } bindm (&bark); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 63 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 63 } bindm (&bar::bark); bindn (&bark); @@ -69,7 +69,7 @@ struct foo { bindb (&bark); bindb (&bar::bark); // { dg-error "ambiguous" } - // { dg-message "candidate" "candidate note" { target *-*-* } 71 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 71 } } }; @@ -92,12 +92,12 @@ struct foo { bind (&barT::baikt); bind (&barf); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 94 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 94 } bind (&foo::barf); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 96 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 96 } bindm (&barf); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 99 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 99 } bindm (&foo::barf); bindn (&barf); @@ -105,15 +105,15 @@ struct foo { bindb (&barf); bindb (&foo::barf); // { dg-error "ambiguous" } - // { dg-message "candidate" "candidate note" { target *-*-* } 107 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 107 } bind (&bark); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 110 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 110 } bind (&barT::bark); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 112 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 112 } bindm (&bark); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 115 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 115 } bindm (&barT::bark); bindn (&bark); @@ -121,7 +121,7 @@ struct foo { bindb (&bark); bindb (&barT::bark); // { dg-error "ambiguous" } - // { dg-message "candidate" "candidate note" { target *-*-* } 123 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 123 } } }; diff --git a/gcc/testsuite/g++.dg/template/error45.C b/gcc/testsuite/g++.dg/template/error45.C index 454acc63149..064554dfe71 100644 --- a/gcc/testsuite/g++.dg/template/error45.C +++ b/gcc/testsuite/g++.dg/template/error45.C @@ -11,7 +11,7 @@ struct enable_if< true, T > template < typename T > struct enable_if< true, T >::type -f( T x ); +f( T x ); // { dg-error "not a class type" } void g( void ) diff --git a/gcc/testsuite/g++.dg/template/friend.C b/gcc/testsuite/g++.dg/template/friend.C index 44cbce938d7..e315a1a0902 100644 --- a/gcc/testsuite/g++.dg/template/friend.C +++ b/gcc/testsuite/g++.dg/template/friend.C @@ -26,5 +26,5 @@ int main() { s<int>::t y; cout << y; // { dg-error "" } - // { dg-message "candidate" "candidate note" { target *-*-* } 28 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 28 } } diff --git a/gcc/testsuite/g++.dg/template/incomplete2.C b/gcc/testsuite/g++.dg/template/incomplete2.C index d86ea06bcd0..b855569088f 100644 --- a/gcc/testsuite/g++.dg/template/incomplete2.C +++ b/gcc/testsuite/g++.dg/template/incomplete2.C @@ -9,6 +9,6 @@ A a; // { dg-error "incomplete type" } void bar() { - foo<a>(); // { dg-error "no matching function" } + foo<a>(); // { dg-error "(no matching function|could not convert)" } // { dg-message "candidate" "candidate note" { target *-*-* } 12 } } diff --git a/gcc/testsuite/g++.dg/template/local4.C b/gcc/testsuite/g++.dg/template/local4.C index 9a03c9a7b98..d842076bd80 100644 --- a/gcc/testsuite/g++.dg/template/local4.C +++ b/gcc/testsuite/g++.dg/template/local4.C @@ -5,6 +5,6 @@ template <typename T> void foo() {} // { dg-message "note" } int main () { struct S {}; - foo<S> (); // { dg-error "match" } + foo<S> (); // { dg-error "(match|template argument for|trying to instantiate)" } // { dg-message "candidate" "candidate note" { target *-*-* } 8 } } diff --git a/gcc/testsuite/g++.dg/template/local6.C b/gcc/testsuite/g++.dg/template/local6.C index 777349a1953..3eb828fd711 100644 --- a/gcc/testsuite/g++.dg/template/local6.C +++ b/gcc/testsuite/g++.dg/template/local6.C @@ -5,7 +5,7 @@ template <class T> struct PCVector2 // { dg-message "note" } PCVector2<T> operator- (const PCVector2<T> &ov) const { return PCVector2<T>(ov.xFIELD, ov.yFIELD); // { dg-error "matching" } - // { dg-message "candidate" "candidate note" { target *-*-* } 7 } + // { dg-message "(candidate|expects 1 argument, 2 provided|cannot convert)" "candidate note" { target *-*-* } 7 } } T xFIELD, yFIELD; diff --git a/gcc/testsuite/g++.dg/template/operator9.C b/gcc/testsuite/g++.dg/template/operator9.C index 35be778765a..46eef0a9ac7 100644 --- a/gcc/testsuite/g++.dg/template/operator9.C +++ b/gcc/testsuite/g++.dg/template/operator9.C @@ -5,6 +5,6 @@ template<operator+> void foo(); // { dg-error "before|non-function|template" } void bar() { foo(); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 7 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 7 } } diff --git a/gcc/testsuite/g++.dg/template/overload12.C b/gcc/testsuite/g++.dg/template/overload12.C new file mode 100644 index 00000000000..656dcaefeed --- /dev/null +++ b/gcc/testsuite/g++.dg/template/overload12.C @@ -0,0 +1,17 @@ +// { dg-do compile } + +struct S {int x; int y;}; +template<typename T> +int foo(T a, T b) {return a + b;} // { dg-message "template" } +template<typename T, typename T2> +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 *-*-* } 8 } + +int foo2(int x) +{ + S s={1,2}; + char c; + foo(c, 2, c); // { dg-error "no matching function" } + // { dg-message "(candidate|deduced conflicting types for)" "candidate note" { target *-*-* } 15 } +} diff --git a/gcc/testsuite/g++.dg/template/ptrmem2.C b/gcc/testsuite/g++.dg/template/ptrmem2.C index 1919047360a..5f03580c1b2 100644 --- a/gcc/testsuite/g++.dg/template/ptrmem2.C +++ b/gcc/testsuite/g++.dg/template/ptrmem2.C @@ -7,7 +7,7 @@ struct A {}; -template <typename T> T A::* Foo (); // { dg-message "note" } +template <typename T> T A::* Foo (); // { dg-error "reference" } void Baz () { diff --git a/gcc/testsuite/g++.dg/template/sfinae2.C b/gcc/testsuite/g++.dg/template/sfinae2.C index e39ca6b76aa..c9e103114dd 100644 --- a/gcc/testsuite/g++.dg/template/sfinae2.C +++ b/gcc/testsuite/g++.dg/template/sfinae2.C @@ -8,7 +8,7 @@ template<int T> struct cl { const static int value = T; }; -template<int I> void fn (char (*) [cl<I>::value] = 0 ); // { dg-message "note" } +template<int I> void fn (char (*) [cl<I>::value] = 0 ); // { dg-error "zero-size array" } void foo (void) { diff --git a/gcc/testsuite/g++.dg/template/ttp25.C b/gcc/testsuite/g++.dg/template/ttp25.C index 861d187d4db..46762ae21af 100644 --- a/gcc/testsuite/g++.dg/template/ttp25.C +++ b/gcc/testsuite/g++.dg/template/ttp25.C @@ -18,12 +18,12 @@ void f4(T, C<5>); // { dg-message "note" } template<int N> struct X {}; void g() { f1(5l, X<5>()); // { dg-error "no matching" } - // { dg-message "candidate" "candidate note" { target *-*-* } 20 } + // { dg-message "(candidate|inconsistent with)" "candidate note" { target *-*-* } 20 } f2(X<5>(), 5); f3(X<5>(), 5l); // { dg-error "no matching" } - // { dg-message "candidate" "candidate note" { target *-*-* } 23 } + // { dg-message "(candidate|inconsistent with)" "candidate note" { target *-*-* } 23 } f4(5, X<5>()); f4(5l, X<5>()); // { dg-error "no matching" } - // { dg-message "candidate" "candidate note" { target *-*-* } 26 } + // { dg-message "(candidate|inconsistent with)" "candidate note" { target *-*-* } 26 } f4((short)5, X<5>()); } diff --git a/gcc/testsuite/g++.dg/template/unify10.C b/gcc/testsuite/g++.dg/template/unify10.C index 8dc434b7577..7f2fd534624 100644 --- a/gcc/testsuite/g++.dg/template/unify10.C +++ b/gcc/testsuite/g++.dg/template/unify10.C @@ -26,34 +26,34 @@ void cvFunction(void (CLASS::* method)() const volatile) {} // { dg-message "not int main() { mFunction(&MyClass::mMethod); mFunction(&MyClass::cMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 28 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 28 } mFunction(&MyClass::vMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 30 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 30 } mFunction(&MyClass::cvMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 32 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 32 } cFunction(&MyClass::mMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 35 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 35 } cFunction(&MyClass::cMethod); cFunction(&MyClass::vMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 38 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 38 } cFunction(&MyClass::cvMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 40 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 40 } vFunction(&MyClass::mMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 43 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 43 } vFunction(&MyClass::cMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 45 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 45 } vFunction(&MyClass::vMethod); vFunction(&MyClass::cvMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 48 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 48 } cvFunction(&MyClass::mMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 51 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 51 } cvFunction(&MyClass::cMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 53 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 53 } cvFunction(&MyClass::vMethod); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 55 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 55 } cvFunction(&MyClass::cvMethod); return 0; diff --git a/gcc/testsuite/g++.dg/template/unify11.C b/gcc/testsuite/g++.dg/template/unify11.C index ed6b31c31c4..25606dc4af8 100644 --- a/gcc/testsuite/g++.dg/template/unify11.C +++ b/gcc/testsuite/g++.dg/template/unify11.C @@ -20,7 +20,7 @@ struct B C (U t) { A a; - A b = foo (this, a, t); // { dg-error "no matching function" } + A b = foo (this, a, t); // { dg-error "(no matching function|is not a)" } // { dg-message "candidate" "candidate note" { target *-*-* } 23 } } } c; diff --git a/gcc/testsuite/g++.dg/template/unify6.C b/gcc/testsuite/g++.dg/template/unify6.C index b12ecb29b21..551c96ebb9f 100644 --- a/gcc/testsuite/g++.dg/template/unify6.C +++ b/gcc/testsuite/g++.dg/template/unify6.C @@ -19,5 +19,5 @@ void Bar () Foo3 (&Baz); Foo3 (&Baz, &Baz); // { dg-error "no matching function" "" } - // { dg-message "candidate" "candidate note" { target *-*-* } 21 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 21 } } diff --git a/gcc/testsuite/g++.dg/template/unify7.C b/gcc/testsuite/g++.dg/template/unify7.C index 2bfa56303da..88d9fd9baa0 100644 --- a/gcc/testsuite/g++.dg/template/unify7.C +++ b/gcc/testsuite/g++.dg/template/unify7.C @@ -11,5 +11,5 @@ int main() { Foo (f); Baz (f); // { dg-error "no matching function" "" } - // { dg-message "candidate" "candidate note" { target *-*-* } 13 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 13 } } diff --git a/gcc/testsuite/g++.dg/template/unify9.C b/gcc/testsuite/g++.dg/template/unify9.C index 40f6b9271fc..f06f83a8d1b 100644 --- a/gcc/testsuite/g++.dg/template/unify9.C +++ b/gcc/testsuite/g++.dg/template/unify9.C @@ -14,5 +14,5 @@ const X *x; int main () { f (*x, &X::g); // { dg-error "no matching function" } - // { dg-message "candidate" "candidate note" { target *-*-* } 16 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 16 } } diff --git a/gcc/testsuite/g++.dg/template/varmod1.C b/gcc/testsuite/g++.dg/template/varmod1.C index 6ae78d9003f..4ba11049b5a 100644 --- a/gcc/testsuite/g++.dg/template/varmod1.C +++ b/gcc/testsuite/g++.dg/template/varmod1.C @@ -7,5 +7,5 @@ void bar() int i; int A[i][i]; foo(A); // { dg-error "" } - // { dg-message "candidate" "candidate note" { target *-*-* } 9 } + // { dg-message "(candidate|not a valid template argument)" "candidate note" { target *-*-* } 9 } } diff --git a/gcc/testsuite/g++.dg/torture/pr49309.C b/gcc/testsuite/g++.dg/torture/pr49309.C deleted file mode 100644 index 620076380b4..00000000000 --- a/gcc/testsuite/g++.dg/torture/pr49309.C +++ /dev/null @@ -1,14 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-fmudflap" } */ -struct A -{ - int i; - - A(); - A(const A&); -}; - -inline void foo(A a) { a = A(); } - -void bar() { foo(A()); } - diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C index a22615dce62..e3bff80e610 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C @@ -278,7 +278,7 @@ SetLD<T>::remove(const T& item) Vix x; for (first(x); 0 != x && this->REMOVE_CURRENT != a; next(x, a)) a = operator()(x) == item ? this->REMOVE_CURRENT: this->NORMAL; // { dg-error "" } .* - // { dg-message "candidate" "candidate note" { target *-*-* } 280 } + // { dg-message "(candidate|not derived from)" "candidate note" { target *-*-* } 280 } } template<class T> bool @@ -287,7 +287,7 @@ SetLD<T>::contains(const T& item) const Vix x; for (first(x); 0 != x; next(x)) { if (operator()(x) == item)// { dg-error "" } .* - // { dg-message "candidate" "candidate note" { target *-*-* } 289 } + // { dg-message "(candidate|not derived from)" "candidate note" { target *-*-* } 289 } return TRUE; } return FALSE; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash28.C b/gcc/testsuite/g++.old-deja/g++.pt/crash28.C index 2cfed93084d..81ed85a28ef 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/crash28.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash28.C @@ -11,5 +11,5 @@ void f(unsigned int n) { int x[n]; asize(x); // { dg-error "" } no matching function - // { dg-message "candidate" "candidate note" { target *-*-* } 13 } + // { dg-message "(candidate|not a valid template argument)" "candidate note" { target *-*-* } 13 } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash60.C b/gcc/testsuite/g++.old-deja/g++.pt/crash60.C index 1aad62132e1..747af9b4090 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/crash60.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash60.C @@ -7,7 +7,7 @@ template< typename SID, class SDR > void k( SID sid, SDR* p, void (SDR::*) - ( typename SID::T ) ); // { dg-message "note" } + ( typename SID::T ) ); // { dg-error "no type named 'T'" } struct E { }; struct S { void f( int ); }; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit41.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit41.C index 560370a8b48..c27d1312381 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit41.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit41.C @@ -1,6 +1,6 @@ // { dg-do assemble } template <int I> -void f(int i); // { dg-message "note" } +void f(int i); // { dg-message "void f" } void g() { diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit77.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit77.C index 1213a1511d3..b97c1cd0223 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit77.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit77.C @@ -15,5 +15,5 @@ void g() { f<0>(s0, s2); f(s0, s2); // { dg-error "" } no matching function - // { dg-message "candidate" "candidate note" { target *-*-* } 17 } + // { dg-message "(candidate|deduced conflicting types|ambiguous base class)" "candidate note" { target *-*-* } 17 } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/expr2.C b/gcc/testsuite/g++.old-deja/g++.pt/expr2.C index 0dcc65f6fac..06d22d5197a 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/expr2.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/expr2.C @@ -9,5 +9,5 @@ void foo(S<J + 2>); // { dg-message "note" } void bar() { foo(S<3>()); // { dg-error "" } no way to deduce J from this. - // { dg-message "candidate" "candidate note" { target *-*-* } 11 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 11 } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C index 85d3e7378ca..8802e983b67 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C @@ -13,9 +13,9 @@ public: }; template <void (A::*)() > -void g() {} // { dg-message "note" } +void g() {} // { dg-message "void g" } template <int A::*> -void h() {} // { dg-message "note" } +void h() {} // { dg-message "void h" } int main() { diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec5.C b/gcc/testsuite/g++.old-deja/g++.pt/spec5.C index df7112ad0d0..96e8cf91160 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/spec5.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/spec5.C @@ -14,9 +14,9 @@ template void g(int i, int j); void h() { f(3, 'c'); // { dg-error "" } no matching function - // { dg-message "candidate" "candidate note" { target *-*-* } 16 } + // { dg-message "(candidate|deduced conflicting types)" "candidate note" { target *-*-* } 16 } g(3, 'c'); // { dg-error "" } no matching function - // { dg-message "candidate" "candidate note" { target *-*-* } 18 } + // { dg-message "(candidate|deduced conflicting types)" "candidate note" { target *-*-* } 18 } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec6.C b/gcc/testsuite/g++.old-deja/g++.pt/spec6.C index fc19c3cf535..b8f6673fa0b 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/spec6.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/spec6.C @@ -25,9 +25,9 @@ void h() { S1 s1; s1.f(3, 'c'); // { dg-error "" } no matching function - // { dg-message "candidate" "candidate note" { target *-*-* } 27 } + // { dg-message "(candidate|deduced conflicting types)" "candidate note" { target *-*-* } 27 } S2<char> s2; s2.f(3, 'c'); // { dg-error "" } no matching function - // { dg-message "candidate" "candidate note" { target *-*-* } 31 } + // { dg-message "(candidate|deduced conflicting types)" "candidate note" { target *-*-* } 31 } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/unify4.C b/gcc/testsuite/g++.old-deja/g++.pt/unify4.C index 6dd9961088d..9285b21c2ee 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/unify4.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/unify4.C @@ -8,6 +8,6 @@ int main () { f (g); // { dg-error "" } ambiguous unification - // { dg-message "candidate" "candidate note" { target *-*-* } 10 } + // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 10 } return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/unify6.C b/gcc/testsuite/g++.old-deja/g++.pt/unify6.C index 0e5c0349544..a6f76744d22 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/unify6.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/unify6.C @@ -19,7 +19,7 @@ template<> void fn<int &>() {} // ok, specialize A template<> void fn<void ()>() {} // ok, specialize A // now make sure we moan when we really should -template<class T> void foo(T const *){} // { dg-message "note" } +template<class T> void foo(T const *){} // { dg-error "pointer to reference" } void f() { diff --git a/gcc/testsuite/g++.old-deja/g++.pt/unify8.C b/gcc/testsuite/g++.old-deja/g++.pt/unify8.C index 320926092f0..3a86d977ec3 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/unify8.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/unify8.C @@ -16,6 +16,6 @@ void Foo (float); // { dg-message "note" } candidate void baz (int **p1) { Foo (p1); // { dg-error "match" } no such function - // { dg-message "candidate" "candidate note" { target *-*-* } 18 } + // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 18 } Bar (p1); // OK } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C index c5620316e9c..410a3369118 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C @@ -15,5 +15,5 @@ void f() { extent(b); // { dg-error "" } no matching function - // { dg-message "candidate" "candidate note" { target *-*-* } 17 } + // { dg-message "(candidate|mismatched types)" "candidate note" { target *-*-* } 17 } } diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x index 4535c611eb4..e05e854846e 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x @@ -7,4 +7,9 @@ if [istarget "avr-*-*"] { # AVR doubles are floats return 1 } +if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } { + # C6X floating point hardware turns denormals to zero in FP conversions. + set torture_execute_xfail "tic6x-*-*" + return 1 +} return 0 diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.x b/gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.x index ee4ac4feb96..c66de1c0648 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.x +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/hugeval.x @@ -19,5 +19,11 @@ if {[istarget "*-*-vxworks*"]} { } } +if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } { + # C6X uses -freciprocal-math by default. + set torture_execute_xfail "$target_triplet" + return 1 +} + return 0 diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x index 5978c94a8ea..418526599d5 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/mul-subnormal-single-1.x @@ -13,4 +13,9 @@ if [istarget "spu-*-*"] { # support subnormals. return 1 } +if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } { + # C6X floating point hardware turns denormals to zero in multiplications. + set torture_execute_xfail "tic6x-*-*" + return 1 +} return 0 diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/mzero2.c b/gcc/testsuite/gcc.c-torture/execute/ieee/mzero2.c index 0da53d24737..00c8efe9136 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/mzero2.c +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/mzero2.c @@ -44,6 +44,8 @@ main () expect (+1.00 * nzero, nzero); expect (-1.00 * nzero, pzero); +#ifndef _TMS320C6700 + /* C6X floating point division is implemented using reciprocals. */ expect (pzero / pzero, nan); expect (pzero / nzero, nan); expect (nzero / pzero, nan); @@ -53,6 +55,7 @@ main () expect (-1.00 / pzero, ninf); expect (+1.00 / nzero, ninf); expect (-1.00 / nzero, pinf); +#endif exit (0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/pr29302-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/pr29302-1.x new file mode 100644 index 00000000000..1922b14d83e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/pr29302-1.x @@ -0,0 +1,12 @@ +if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } { + # C6X uses -freciprocal-math by default. + set torture_execute_xfail "tic6x-*-*" + return 1 +} +return 0 +if { [istarget "tic6x-*-*"] && [check_effective_target_ti_c67x] } { + # C6X uses -freciprocal-math by default. + set torture_execute_xfail "tic6x-*-*" + return 1 +} +return 0 diff --git a/gcc/testsuite/gcc.dg/torture/builtin-math-7.c b/gcc/testsuite/gcc.dg/torture/builtin-math-7.c index 754d3f0b442..064e28641a7 100644 --- a/gcc/testsuite/gcc.dg/torture/builtin-math-7.c +++ b/gcc/testsuite/gcc.dg/torture/builtin-math-7.c @@ -5,6 +5,7 @@ Origin: Kaveh R. Ghazi, August 13, 2009. */ /* { dg-do run } */ +/* C6X fails due to -freciprocal-math default. */ /* { dg-skip-if "" { tic6x-*-* } "*" "" } */ /* { dg-add-options ieee } */ /* { dg-require-effective-target large_double } */ diff --git a/gcc/testsuite/gcc.dg/torture/type-generic-1.c b/gcc/testsuite/gcc.dg/torture/type-generic-1.c index add83c09815..f6949cff136 100644 --- a/gcc/testsuite/gcc.dg/torture/type-generic-1.c +++ b/gcc/testsuite/gcc.dg/torture/type-generic-1.c @@ -3,6 +3,7 @@ /* { dg-do run } */ /* { dg-skip-if "No Inf/NaN support" { spu-*-* } } */ +/* { dg-options "-DUNSAFE" { target tic6x*-*-* } } */ /* { dg-add-options ieee } */ #include "../tg-tests.h" diff --git a/gcc/testsuite/gfortran.dg/coarray/scalar_alloc_1.f90 b/gcc/testsuite/gfortran.dg/coarray/scalar_alloc_1.f90 new file mode 100644 index 00000000000..528dd3e092f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray/scalar_alloc_1.f90 @@ -0,0 +1,68 @@ +! { dg-do run } +! +implicit none +integer, allocatable :: A[:], B[:,:] +integer :: n1, n2, n3 + +if (allocated (a)) call abort () +if (allocated (b)) call abort () + +allocate(a[*]) +a = 5 + this_image () +if (a[this_image ()] /= 5 + this_image ()) call abort + +a[this_image ()] = 8 - 2*this_image () +if (a[this_image ()] /= 8 - 2*this_image ()) call abort + +if (lcobound(a, dim=1) /= 1 .or. ucobound(a,dim=1) /= num_images()) & + call abort () +deallocate(a) + +allocate(a[4:*]) +a[this_image ()] = 8 - 2*this_image () + +if (lcobound(a, dim=1) /= 4 .or. ucobound(a,dim=1) /= 3 + num_images()) & + call abort () + +n1 = -1 +n2 = 5 +n3 = 3 +allocate (B[n1:n2, n3:*]) +if (any (lcobound(b) /= [-1, 3]) .or. lcobound(B, dim=2) /= n3) & + call abort() +call sub(A, B) + +if (allocated (a)) call abort () +if (.not.allocated (b)) call abort () + +call two(.true.) +call two(.false.) + +! automatically deallocate "B" +contains + subroutine sub(x, y) + integer, allocatable :: x[:], y[:,:] + + if (any (lcobound(y) /= [-1, 3]) .or. lcobound(y, dim=2) /= n3) & + call abort() + if (lcobound(x, dim=1) /= 4 .or. ucobound(x,dim=1) /= 3 + num_images()) & + call abort () + if (x[this_image ()] /= 8 - 2*this_image ()) call abort + deallocate(x) + end subroutine sub + + subroutine two(init) + logical, intent(in) :: init + integer, allocatable, SAVE :: a[:] + + if (init) then + if (allocated(a)) call abort() + allocate(a[*]) + a = 45 + else + if (.not. allocated(a)) call abort() + if (a /= 45) call abort() + deallocate(a) + end if + end subroutine two +end diff --git a/gcc/testsuite/gfortran.dg/coarray/scalar_alloc_2.f90 b/gcc/testsuite/gfortran.dg/coarray/scalar_alloc_2.f90 new file mode 100644 index 00000000000..50c3dfb2ea8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray/scalar_alloc_2.f90 @@ -0,0 +1,60 @@ +! { dg-do run } +! +! Check whether registering allocatable coarrays works +! +type position + real :: x, y, z +end type position + +integer, allocatable :: a[:] +type(position), allocatable :: p[:] + +allocate(a[*]) +a = 7 + +allocate(p[*]) +p%x = 11 +p%y = 13 +p%z = 15 + +if (a /= 7) call abort() +a = 88 +if (a /= 88) call abort() + +if (p%x /= 11) call abort() +p%x = 17 +if (p%x /= 17) call abort() + + block + integer, allocatable :: b[:] + + allocate(b[*]) + b = 8494 + + if (b /= 8494) call abort() + end block + +if (a /= 88) call abort() +call test () +end + +subroutine test() + type velocity + real :: x, y, z + end type velocity + + real, allocatable :: z[:] + type(velocity), allocatable :: v[:] + + allocate(z[*]) + z = sqrt(2.0) + + allocate(v[*]) + v%x = 21 + v%y = 23 + v%z = 25 + + if (z /= sqrt(2.0)) call abort() + if (v%x /= 21) call abort() + +end subroutine test diff --git a/gcc/testsuite/gfortran.dg/coarray_14.f90 b/gcc/testsuite/gfortran.dg/coarray_14.f90 index 3e3f0462b30..49188d60e15 100644 --- a/gcc/testsuite/gfortran.dg/coarray_14.f90 +++ b/gcc/testsuite/gfortran.dg/coarray_14.f90 @@ -49,7 +49,7 @@ type t end type t type(t), allocatable :: a[:] allocate (t :: a) ! { dg-error "Coarray specification required in ALLOCATE statement" } -allocate (t :: a[*]) ! { dg-error "allocatable scalar coarrays are not yet supported" } +allocate (t :: a[*]) ! OK end program myTest ! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/coarray_7.f90 b/gcc/testsuite/gfortran.dg/coarray_7.f90 index 29af0d19195..abbd64dd544 100644 --- a/gcc/testsuite/gfortran.dg/coarray_7.f90 +++ b/gcc/testsuite/gfortran.dg/coarray_7.f90 @@ -90,7 +90,7 @@ type(t), allocatable :: b(:)[:], C[:] allocate(b(1)) ! { dg-error "Coarray specification" } allocate(a[3]%a(5)) ! { dg-error "Coindexed allocatable" } -allocate(c[*]) ! { dg-error "Sorry" } +allocate(c[*]) ! OK allocate(a%a(5)) ! OK end subroutine alloc @@ -151,9 +151,9 @@ subroutine allocateTest() integer :: n, q n = 1 q = 1 - allocate(a[q,*]) ! { dg-error "Sorry" } - allocate(b[q,*]) ! { dg-error "Sorry" } - allocate(c[q,*]) ! { dg-error "Sorry" } + allocate(a[q,*]) ! OK + allocate(b[q,*]) ! OK + allocate(c[q,*]) ! OK end subroutine allocateTest diff --git a/gcc/testsuite/gfortran.dg/generic_17.f90 b/gcc/testsuite/gfortran.dg/generic_17.f90 index 968d9c10c37..0e9a41d5b02 100644 --- a/gcc/testsuite/gfortran.dg/generic_17.f90 +++ b/gcc/testsuite/gfortran.dg/generic_17.f90 @@ -34,7 +34,7 @@ module foo_mod use d_foo_mod
end module foo_mod
-subroutine s_foobar(x)
+subroutine s_foobar2(x)
use foo_mod
-end subroutine s_foobar
+end subroutine s_foobar2
! { dg-final { cleanup-modules "s_foo_mod d_foo_mod foo_mod" } } diff --git a/gcc/testsuite/gfortran.dg/interface_3.f90 b/gcc/testsuite/gfortran.dg/interface_3.f90 index 0a23fb09806..1d954eef8b6 100644 --- a/gcc/testsuite/gfortran.dg/interface_3.f90 +++ b/gcc/testsuite/gfortran.dg/interface_3.f90 @@ -5,6 +5,8 @@ ! ! Contributed by Joost VandeVondele <jv244@cam.ac.uk> ! +! Modified for PR fortran/34657 +! module test_mod interface subroutine my_sub (a) @@ -30,14 +32,14 @@ end module ! This is the original PR, excepting that the error requires the symbol ! to be referenced. subroutine my_sub (a) - use test_mod + use test_mod ! { dg-error "is also the name of the current program unit" } real a call my_sub (a) ! { dg-error "ambiguous reference" } print *, a end subroutine integer function my_fun (a) - use test_mod + use test_mod ! { dg-error "is also the name of the current program unit" } real a print *, a my_fun = 1 ! { dg-error "ambiguous reference" } diff --git a/gcc/testsuite/gfortran.dg/pointer_remapping_7.f90 b/gcc/testsuite/gfortran.dg/pointer_remapping_7.f90 new file mode 100644 index 00000000000..39126bac405 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pointer_remapping_7.f90 @@ -0,0 +1,8 @@ +! { dg-do compile } +! +! PR fortran/49624 +! + integer, target :: A(100) + integer,pointer :: P(:,:) + p(10,1:) => A ! { dg-error "Lower bound has to be present" } + end diff --git a/gcc/testsuite/gfortran.dg/use_14.f90 b/gcc/testsuite/gfortran.dg/use_14.f90 new file mode 100644 index 00000000000..63f3dff98b0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/use_14.f90 @@ -0,0 +1,19 @@ +! { dg-do compile } +! +! PR fortran/34657 +! +module test_mod +interface + subroutine my_sub (a) + real a + end subroutine +end interface +end module + +subroutine my_sub (a) + use test_mod, gugu => my_sub + real a + print *, a +end subroutine + +END diff --git a/gcc/testsuite/gfortran.dg/use_15.f90 b/gcc/testsuite/gfortran.dg/use_15.f90 new file mode 100644 index 00000000000..099588836e0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/use_15.f90 @@ -0,0 +1,39 @@ +! { dg-do compile } +! +! PR fortran/34657 +! +module test_mod +interface + subroutine my_sub (a) + real a + end subroutine +end interface +end module + +subroutine my_sub (a) + use test_mod ! { dg-error "is also the name of the current program unit" } + real a + print *, a +end subroutine + + +module test_mod2 + integer :: my_sub2 +end module + +subroutine my_sub2 (a) + use test_mod2 ! { dg-error "is also the name of the current program unit" } + real a + print *, a +end subroutine + + +subroutine my_sub3 (a) + use test_mod2, my_sub3 => my_sub2 ! { dg-error "is also the name of the current program unit" } + real a + print *, a +end subroutine + +END + +! { dg-final { cleanup-modules "test_mod test_mod2" } } diff --git a/gcc/testsuite/gnat.dg/pointer_controlled.adb b/gcc/testsuite/gnat.dg/pointer_controlled.adb new file mode 100644 index 00000000000..1d85b53fec3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/pointer_controlled.adb @@ -0,0 +1,31 @@ +-- PR ada/49732 +-- Testcase by Vorfeed Canal + +-- { dg-do compile } +-- { dg-options "-gnato" } + +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Interfaces.C.Pointers; + +procedure Pointer_Controlled is + + function Create (Name : String) return size_t is + + type Name_String is new char_array (0 .. Name'Length); + type Name_String_Ptr is access Name_String; + pragma Controlled (Name_String_Ptr); + + Name_Str : constant Name_String_Ptr := new Name_String; + Name_Len : size_t; + + begin + To_C (Name, Name_Str.all, Name_Len); + return 1; + end; + + Test : size_t; + +begin + Test := Create("ABC"); +end; diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 81c4398a4e1..9e269b12d66 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -307,3 +307,34 @@ proc g++_target_compile { source dest type options } { return $result } + +# +# ${tool}_option_help +# +# Changed "additional" to "extra" because runtest.exp treats --a* as --all. +# +# This shouldn't be necessary at all; it should be entirely redundant with +# --tool_opts, except that --tool_opts currently breaks multilib: see +# http://lists.gnu.org/archive/html/dejagnu/2002-10/msg00007.html + +proc ${tool}_option_help { } { + send_user " --extra_opts,OPTIONS\t\tUse OPTIONS to compile the testcase files. OPTIONS should be comma-separated.\n" +} + +# +# ${tool}_option_proc +# + +proc ${tool}_option_proc { option } { + if [regexp "^--extra_opts," $option] { + global gpp_compile_options + regsub "^--extra_opts," $option "" option + foreach x [split $option ","] { + lappend gpp_compile_options "additional_flags=$x" + } + verbose -log "gpp_compile_options set to $gpp_compile_options" + return 1 + } else { + return 0 + } +} diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp index f5cbc4ca62e..4683f931589 100644 --- a/gcc/testsuite/lib/prune.exp +++ b/gcc/testsuite/lib/prune.exp @@ -20,7 +20,7 @@ proc prune_gcc_output { text } { #send_user "Before:$text\n" - regsub -all "(^|\n)(\[^\n\]*: )?In ((static member |lambda )?function|member|method|(copy )?constructor|destructor|instantiation|program|subroutine|block-data)\[^\n\]*" $text "" text + regsub -all "(^|\n)(\[^\n\]*: )?In ((static member |lambda )?function|member|method|(copy )?constructor|destructor|instantiation|substitution|program|subroutine|block-data)\[^\n\]*" $text "" text regsub -all "(^|\n)\[^\n\]*(: )?At (top level|global scope):\[^\n\]*" $text "" text regsub -all "(^|\n)\[^\n\]*: (recursively )?required \[^\n\]*" $text "" text regsub -all "(^|\n)\[^\n\]*: . skipping \[0-9\]* instantiation contexts \[^\n\]*" $text "" text |