[Bug c++/43131] New: internal compiler error: tree check expected class �type� have �exceptional�

2010-02-21 Thread kian dot karas dot dev at gmail dot com
Seen with gcc 4.4.0:

$ gcc temp.cpp -I../..
In file included from temp.cpp:2:
../../gptm/thread_scope_new.h:128: internal compiler error: tree check:
expected class ‘type’, have ‘exceptional’ (identifier_node) in
constructor_name_full, at cp/name-lookup.c:1777
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.


$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-dl/configure
Thread model: posix
gcc version 4.4.0 20090217 (experimental) (GCC)


I don't know, but it might relate to bug 43082.


-- 
   Summary: internal compiler error: tree check expected class
‘type’ have ‘exceptional’
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kian dot karas dot dev at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43131



[Bug c++/43131] internal compiler error: tree check expected class �type� have �exceptional�

2010-02-21 Thread kian dot karas dot dev at gmail dot com


--- Comment #1 from kian dot karas dot dev at gmail dot com  2010-02-21 
12:02 ---
Created an attachment (id=19931)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19931action=view)
Preprocessed file


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43131



[Bug c++/40066] New: Placement delete not called when constructor throws

2009-05-08 Thread kian dot karas dot dev at gmail dot com
This might relate to bug 34158 comment #6.

When throwing an exception in the constructor of an object being allocated as a
result of a call to a (placement) new expression, the corresponding (placement)
operator delete does not get called - unless the new expression is placed
inside a try-catch block AND the exception being throw can be caught by the
catch block.

The expected output of the code below would be (the address' may be different)
allocate 0x804a008
dealloc 0x804a008
allocate 0x804a008
dealloc 0x804a008
terminate called after throwing an instance of 'std::exception'
  what():  std::exception
Aborted

but unless the try-catch block is included, it outputs

allocate 0x804a008
dealloc 0x804a008
allocate 0x804a008
terminate called after throwing an instance of 'std::exception'
  what():  std::exception
Aborted

Note: If including the try-catch block, but changing the exception-declaration
of the catch to e.g. 'int', the operator delete still does not get called.



#include iostream
using namespace std;

struct Arena {
void* allocate(std::size_t s) {return ::operator new(s);}
void deallocate(void* p) { ::operator delete(p); }
};

inline void* operator new(std::size_t sz, Arena a)
{
void* p = a.allocate(sz);
cout  allocate   p  endl;
return p;
}

inline void operator delete(void* p, Arena a)
{
cout  dealloc   p  endl;
a.deallocate(p);
}

struct Thrower {
Thrower(bool b) { if (b) throw std::exception();}
};

int main()
{
Arena arena;

Thrower* p = new(arena) Thrower(false);

operator delete(p, arena);

//try {
p = new(arena) Thrower(true); // - Memory does not get deallocated
//}
//catch (std::exception) {
//cout  catch  endl;
//}

return 0;
}


-- 
   Summary: Placement delete not called when constructor throws
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kian dot karas dot dev at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40066