Commit 6b3fb344 by Paolo Carlini Committed by Paolo Carlini

testsuite_api.h (diamond_derivation<>::test): Expect ambiguity together with the…

testsuite_api.h (diamond_derivation<>::test): Expect ambiguity together with the standard exception classes.

2008-08-05  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/util/testsuite_api.h (diamond_derivation<>::test):
	Expect ambiguity together with the standard exception classes.
	* testsuite/27_io/ios_base/failure/cons_virtual_derivation.cc: Remove
	xfail.
	* testsuite/19_diagnostics/logic_error/cons_virtual_derivation.cc:
	Likewise.
	* testsuite/19_diagnostics/runtime_error/cons_virtual_derivation.cc:
	Likewise.
	* testsuite/19_diagnostics/system_error/cons_virtual_derivation.cc:
	Likewise.
	* testsuite/18_support/bad_alloc/cons_virtual_derivation.cc: Likewise.
	* testsuite/18_support/bad_cast/cons_virtual_derivation.cc: Likewise.
	* testsuite/18_support/bad_exception/cons_virtual_derivation.cc:
	Likewise.
	* testsuite/18_support/bad_typeid/cons_virtual_derivation.cc:
	Likewise.
	* testsuite/ext/concurrence_lock_error/cons_virtual_derivation.cc:
	Likewise.
	* testsuite/ext/forced_exception_error/cons_virtual_derivation.cc:
	Likewise.
	* testsuite/ext/concurrence_unlock_error/cons_virtual_derivation.cc:
	Likewise.
	* testsuite/20_util/bad_function_call/cons_virtual_derivation.cc:
	Likewise.

From-SVN: r138737
parent 7352e27c
2008-08-05 Paolo Carlini <paolo.carlini@oracle.com>
* testsuite/util/testsuite_api.h (diamond_derivation<>::test):
Expect ambiguity together with the standard exception classes.
* testsuite/27_io/ios_base/failure/cons_virtual_derivation.cc: Remove
xfail.
* testsuite/19_diagnostics/logic_error/cons_virtual_derivation.cc:
Likewise.
* testsuite/19_diagnostics/runtime_error/cons_virtual_derivation.cc:
Likewise.
* testsuite/19_diagnostics/system_error/cons_virtual_derivation.cc:
Likewise.
* testsuite/18_support/bad_alloc/cons_virtual_derivation.cc: Likewise.
* testsuite/18_support/bad_cast/cons_virtual_derivation.cc: Likewise.
* testsuite/18_support/bad_exception/cons_virtual_derivation.cc:
Likewise.
* testsuite/18_support/bad_typeid/cons_virtual_derivation.cc:
Likewise.
* testsuite/ext/concurrence_lock_error/cons_virtual_derivation.cc:
Likewise.
* testsuite/ext/forced_exception_error/cons_virtual_derivation.cc:
Likewise.
* testsuite/ext/concurrence_unlock_error/cons_virtual_derivation.cc:
Likewise.
* testsuite/20_util/bad_function_call/cons_virtual_derivation.cc:
Likewise.
2008-08-04 Paolo Carlini <paolo.carlini@oracle.com> 2008-08-04 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/postypes.h: Reinstate inclusion of <stdint.h>; * include/bits/postypes.h: Reinstate inclusion of <stdint.h>;
......
// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// { dg-options "-std=gnu++0x" } // { dg-options "-std=gnu++0x" }
// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// { dg-do run { xfail *-*-* } }
// { dg-options "-std=gnu++0x" } // { dg-options "-std=gnu++0x" }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com> // 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
// -*- C++ -*- // -*- C++ -*-
// Exception testing utils for the C++ library testsuite. // Exception testing utils for the C++ library testsuite.
// //
// Copyright (C) 2007 Free Software Foundation, Inc. // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -47,16 +47,19 @@ namespace __gnu_test ...@@ -47,16 +47,19 @@ namespace __gnu_test
template<typename Exception> template<typename Exception>
struct diamond_derivation_base<Exception, true> struct diamond_derivation_base<Exception, true>
{ {
struct diamond_derivation_error: bad_non_virtual, Exception struct diamond_derivation_error
: bad_non_virtual, Exception
{ {
diamond_derivation_error() : bad_non_virtual(), Exception() { } diamond_derivation_error()
: bad_non_virtual(), Exception() { }
}; };
}; };
template<typename Exception> template<typename Exception>
struct diamond_derivation_base<Exception, false> struct diamond_derivation_base<Exception, false>
{ {
struct diamond_derivation_error: bad_non_virtual, Exception struct diamond_derivation_error
: bad_non_virtual, Exception
{ {
diamond_derivation_error() diamond_derivation_error()
: bad_non_virtual(), Exception("construct diamond") { } : bad_non_virtual(), Exception("construct diamond") { }
...@@ -64,18 +67,25 @@ namespace __gnu_test ...@@ -64,18 +67,25 @@ namespace __gnu_test
}; };
template<typename Exception, bool DefaultCons> template<typename Exception, bool DefaultCons>
struct diamond_derivation: diamond_derivation_base<Exception, DefaultCons> struct diamond_derivation
: diamond_derivation_base<Exception, DefaultCons>
{ {
typedef diamond_derivation_base<Exception, DefaultCons> base_type; typedef diamond_derivation_base<Exception, DefaultCons> base_type;
typedef typename base_type::diamond_derivation_error error_type; typedef typename base_type::diamond_derivation_error error_type;
// NB: In the libstdc++-v3 testsuite, all the standard exception
// classes (+ a couple of extensions) are checked: since they
// all derive *non* virtually from std::exception, the expected
// behavior is ambiguity.
static void test() static void test()
{ {
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
try { throw error_type(); } try
catch (std::exception const& e) { } { throw error_type(); }
catch (...) catch (std::exception const&)
{ VERIFY( false ); } { VERIFY( false ); }
catch (...)
{ VERIFY( true ); }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment