Bug 24809 - is_polymorphic doesn't compile if the argument type has non-throwing destructor
Summary: is_polymorphic doesn't compile if the argument type has non-throwing destructor
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.0.2
: P3 normal
Target Milestone: 4.0.3
Assignee: Paolo Carlini
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-11 18:47 UTC by John Maddock
Modified: 2005-11-13 12:22 UTC (History)
1 user (show)

See Also:
Host: linux.x86
Target: linux.x86
Build: linux.x86
Known to work:
Known to fail:
Last reconfirmed: 2005-11-11 19:02:33


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Maddock 2005-11-11 18:47:42 UTC
Title say it all really, test case is:

#include <tr1/type_traits>
#include <exception>

static const bool b = std::tr1::is_polymorphic<std::exception>::value;

which produces:

/usr/local/gcc/4.0.2/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../include/c++/4.0.2/tr1/type_traits: In instantiation of `std::tr1::__is_polymorphic_helper<std::exception, false>::__second<std::exception>':
/usr/local/gcc/4.0.2/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../include/c++/4.0.2/tr1/type_traits:328:   instantiated from `const bool std::tr1::__is_polymorphic_helper<std::exception, false>::__value'
/usr/local/gcc/4.0.2/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../include/c++/4.0.2/tr1/type_traits:338:   instantiated from `std::tr1::is_polymorphic<std::exception>'
/home/john/boost/libs/type_traits/test/is_polymorphic_test.cpp:61:   instantiated from here
/usr/local/gcc/4.0.2/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../include/c++/4.0.2/tr1/type_traits:324: error: looser throw specifier for `std::tr1::__is_polymorphic_helper<_Tp, <anonymous> >::__second<_Up>::~__second() [with _Up = std::exception, _Tp = std::exception, bool <anonymous> = false]'
/usr/local/gcc/4.0.2/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../include/c++/4.0.2/exception:58: error:   overriding `virtual std::exception::~exception() throw ()'

Regards, John Maddock.
Comment 1 John Maddock 2005-11-11 18:54:40 UTC
And just to add to the above, this bug also effects is_enum and is_function.

John.
Comment 2 Paolo Carlini 2005-11-11 19:02:33 UTC
Ok ;) Thanks!
Comment 3 paolo@gcc.gnu.org 2005-11-11 20:10:26 UTC
Subject: Bug 24809

Author: paolo
Date: Fri Nov 11 20:10:20 2005
New Revision: 106796

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106796
Log:
2005-11-11  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/24799
	* include/tr1/functional (hash): Inherit from std::unary_function.
	* testsuite/tr1/6_containers/unordered/hash/24799.cc: New.

	PR libstdc++/24805
	* include/tr1/boost_shared_ptr.h (swap(shared_ptr<>&, shared_ptr<>&),
	swap(weak_ptr<>&, weak_ptr<>&)): Move inside namespace tr1.
	* testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/
	24805.cc: New.

	PR libstdc++/24809
	* include/tr1/type_traits (__is_polymorhpic_helper): Adjust destructor.
	* testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/
	24809.cc: New.


Added:
    trunk/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/24805.cc
    trunk/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/24809.cc
    trunk/libstdc++-v3/testsuite/tr1/6_containers/unordered/hash/
    trunk/libstdc++-v3/testsuite/tr1/6_containers/unordered/hash/24799.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/tr1/boost_shared_ptr.h
    trunk/libstdc++-v3/include/tr1/functional
    trunk/libstdc++-v3/include/tr1/type_traits

Comment 4 paolo@gcc.gnu.org 2005-11-13 12:19:09 UTC
Subject: Bug 24809

Author: paolo
Date: Sun Nov 13 12:19:01 2005
New Revision: 106864

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106864
Log:
2005-11-13  Douglas Gregor  <doug.gregor@gmail.com>

	PR libstdc++/24818
        * include/tr1/ref_wrap_iterate.h
        (reference_wrapper::operator()()): Don't dereferene the result of
        get() before calling it; it's already a reference.
        * testsuite/tr1/3_function_objects/reference_wrapper/invoke.cc:
        Test nullary calls to reference_wrappers.

2005-11-13  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/24799
	* include/tr1/functional (hash): Inherit from std::unary_function.
	* testsuite/tr1/6_containers/unordered/hash/24799.cc: New.

	PR libstdc++/24805
	* include/tr1/boost_shared_ptr.h (swap(shared_ptr<>&, shared_ptr<>&),
	swap(weak_ptr<>&, weak_ptr<>&)): Move inside namespace tr1.
	* testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/
	24805.cc: New.

	PR libstdc++/24809
	* include/tr1/type_traits (__is_polymorhpic_helper): Adjust destructor.
	* testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/
	24809.cc: New.

Added:
    branches/gcc-4_0-branch/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/24805.cc
    branches/gcc-4_0-branch/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/24809.cc
    branches/gcc-4_0-branch/libstdc++-v3/testsuite/tr1/6_containers/unordered/hash/
    branches/gcc-4_0-branch/libstdc++-v3/testsuite/tr1/6_containers/unordered/hash/24799.cc
Modified:
    branches/gcc-4_0-branch/libstdc++-v3/ChangeLog
    branches/gcc-4_0-branch/libstdc++-v3/include/tr1/boost_shared_ptr.h
    branches/gcc-4_0-branch/libstdc++-v3/include/tr1/functional
    branches/gcc-4_0-branch/libstdc++-v3/include/tr1/ref_wrap_iterate.h
    branches/gcc-4_0-branch/libstdc++-v3/include/tr1/type_traits
    branches/gcc-4_0-branch/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/invoke.cc

Comment 5 Paolo Carlini 2005-11-13 12:22:16 UTC
Fixed for 4.0.3.