internal compiler error: in type_throw_all_p, at cp/except.c:1307
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-4.9 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
ubuntu 16.04, gcc 4.9.4 installed from: ppa:ubuntu-
When compile a simple test code:
/.../__
{}
^
Please submit a full bug report,
The full code is here:
///////
#include <iostream>
#include <string>
#include <iomanip>
#include <limits.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <map>
#include <math.h>
#include <typeinfo>
#include <deque>
#include <new>
#include <bitset>
#include <typeinfo>
#include <memory>
using namespace std;
template<class _TT>
struct DeletorBase
{
typedef _TT value_type;
typedef _TT* pointer;
typedef const _TT* const_pointer;
static constexpr bool ShouldThrow(void)
{ return true; }
};
template<class _TT>
struct GuardedDeletor : DeletorBase<_TT>
{
static constexpr bool ShouldThrow(void)
{ return !std::is_
static inline void del(typename DeletorBase<
{
if (ShouldThrow()) // Compiling time optimize
{
try
{
delete p;
}
catch (...)
{
operator delete(p);
throw;
}
}
else
{
delete p;
}
}
};
template< class _TT, class _DEL = GuardedDeletor< _TT > >
class CMyHandle
{
public:
CMyHandle(_TT* ptr)
: m_ptr(ptr)
{}
~CMyHandle() noexcept(
{ _DEL::del(m_ptr); }
private:
_TT* m_ptr;
};
class CMyClass
{
public:
CMyClass(int n = 0)
: m_thTest(new std::string)
{}
~CMyClass()
{}
typedef CMyHandle< std::string > THCLI;
THCLI m_thTest;
};
int
main(int argc, char* argv[])
{
return 0;
}
///////
The compile command line is:
g++-4.9 -Wall -fexceptions -fvisibility=hidden -march=athlon64 -O3 -w -std=c++11 --param inline-
If I change `~MyClass()` to `~MyClass() noexcept` than everything is ok.