help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: checking for std=c++0x


From: Jeffrey Schwab
Subject: Re: checking for std=c++0x
Date: Mon, 11 Apr 2011 08:06:18 -0700 (PDT)
User-agent: G2/1.0

On Saturday, April 9, 2011 12:22:00 PM UTC-4, Matt P. Dz. wrote:

> From N3242 (draft):
> 
> "16.8 Predefined macro names [cpp.predefined]
> 
> 1 The following macro names shall be defined by the implementation:
> __cplusplus
> The name __cplusplus is defined to the value 201103L when compiling a
> C++ translation unit.155
> 155) It is intended that future versions of this standard will replace
> the value of this macro with a greater value. Non-conforming
> compilers should use a value with at most five decimal digits."

GCC 4.6 seems define __cplusplus as 1.  Does this quailify as a bug?

$ cat main.cpp
#include <iostream>
int main() { std::cout << __cplusplus << std::endl; }
$ make
g++ -std=c++0x -pedantic -Wall -I. -o main.o -c main.cpp
g++ -o main main.o
$ ./main
1
$ g++ --version
g++ (GCC) 4.6.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]