This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: enum destructor call difference between c++2011 and previous c++ version. is it a bug ?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: mickael guene <mickael dot guene at st dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 6 Apr 2012 16:40:16 +0100
- Subject: Re: enum destructor call difference between c++2011 and previous c++ version. is it a bug ?
- References: <4F7ECEB0.8050800@st.com>
On 06/04/2012, mickael guene <mickael.guene@st.com> wrote:
> 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
>
I think g++ is correct, the example is valid in C++03 but C++2011 says
in [basic.lookup.qual]
"A name prefixed by a nested-name-specifier that nominates an
enumeration type shall represent an enumerator of that enumeration."