- To: <gcc-help@xxxxxxxxxxx>
- Subject: enum destructor call difference between c++2011 and previous c++ version. is it a bug ?
- From: mickael guene <mickael.guene@xxxxxx>
- Date: Fri, 6 Apr 2012 13:08:32 +0200
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110921 Lightning/1.0b2 Thunderbird/3.1.15
Hi all,
When compiling attach code with or without -std=c++0x option I notice that
-std=c++0x is more strict concerning enum destructor call.
I was wondering if it's a bug in compiler or a normal behaviour. I have
found no help from c++ standard.
I'm using gcc 4.6.3 and compile code with following command line:
g++ -std=gnu++0x foo.cpp -c => for c++2011
g++ foo.cpp -c
Mickael
enum E { A, B };
void foo()
{
E e = B;
e.~E(); // ok with and without -std=c++0x
e.E::~E(); // ok without -std=c++0x. Compilation error with -std=c++0x =>
// request for member â??E::~Eâ?? in â??eâ??, which is of non-class type â??Eâ??
}
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]