C/C++ and Fortran

xlC++ compiler's C++11 support

By Archive User posted Tue September 20, 2011 11:25 AM

  

Originally posted by: Michael_Wong


ATTENTION: this blog post is now old information, kept here only for older service compiler information purposes. A new blog will show the new XLC++ 13.1.2 and future compiler's C++ Standard Compliance Status.

 

C++11 (which was codenamed C++0x until ratification) is the new C++ programming language standard that has just been ratified and published. It supersedes the C++ 2003 (which was a bug fix on the C++ 1998) Standard and is called officially ISO/IEC 14882: 2011

IBM's xlC (C++) compiler has started supporting C++11 since 2008 in V10.1 with an extensive list of C++11 features. Our current release is now at V12.1 on AIX and Linux and V2R1 for z/OS. Most other compilers have similar plans phasing in the large number of features over multiple releases. The latest compiler support is here.

Here is a list of C++11 features supported over several releases of XL C/C++.

 

pSeries AIX and Linux systems:


C++11 features supported in XL C/C++ for AIX V10.1 and XL Linux for Linux V10.1 released in mid 2008:

 

  • -qlanglvl=extended0x option (umbrella option for all future C++0x features)
  • Long long
  • sync C99 preprocessor:
    • Empty macro arguments
    • Variadic macros
    • Trailing comma in enum definition
    • Concatenation of mixed-width string literal

 

In addition, it also has been tested with Boost Libraries V1.34.1.
The compiler documentation is available online.
 
C++11 Features supported in XL C/C++ for AIX V11.1 and XL C/C++ for Linux V11.1 released in mid 2010 (including previous AIX and Linux released features):
  • Variadic template
  • Auto
  • Decltype
  • Namespace association
  • Delegating constructor
  • Static assert
  • extern template
  • extended friend
  • -qwarn0x

In addition, it also has been tested with Boost Libraries V1.40.

The compiler documentation is available online.
 
C++11 features supported in XL C/C++ for AIX/Linux for V12.1 released in mid 2012 (including previous AIX and Linux released features)
  • Explicit conversion operator
  • Generalized const expr
  • Rvalue reference
  • Right angle bracket
  • Scoped enum
  • Forward declaration of enums
  • Trailing return
  • C11 complex
  • C11 _Noreturn
  • C11 Anonymous structs
In addition, it also has been tested with Boost Libraries V1.47.
The compiler documentation is available online.
 
C++11 features supported in XL C/C++ for AIX/Linux for V13.1 released in mid 2014 (including previous AIX and Linux released features)
  • Defaulted and deleted functions
  • The nullptr keyword
In addition, it also has been tested with Boost Libraries V1.55.
The compiler documentation is available online.

 

zSeries Systems:

C++11 features supported in z/OS XL C/C++ V1R11:
  • Extern template
  • Extended friend
  • -qwarn0x
The compiler documentation is available online.
 
C++ 11 features supported in z/OS XL C/C++ V1R12 (including previous z/OS released features):
  • Long long
  • sync C99 preprocessor
    • Empty macro arguments
    • Variadic macros
    • Trailing comma in enum definition
    • Concatenation of mixed-width string literal
  • Auto
  • Decltype
  • Variadic template
  • Namespace association
  • Delegating constructor
  • Static assert
The compiler documentation is available online.
 
C++ 11 features supported in z/OS XL C/C++ V1R13 (including previous z/OS released features):
  • QOI Message
  • Trailing return
The compiler documentation is available online.
 

C++11 features supported in z/OS XL C/C++ V2R1 (including previous z/OS released features):

  • Explicit Conversion Operators
  • Generalized constant expressions
  • Right Angle Brackets
  • Scoped Enum

The compiler documentation is available online.
 

We plan to continue our drive and commitment to fully support C++11 in future compiler releases.

C++11 library support is also planned for the future. So stay tuned.

If you are interested in more information on C++11, then here is Bjarne's C++0x FAQ.

 

Here is what it looks like in table format comparable to what other Open Source compilers have shown:

C++11 Language Feature C++11 Proposal Available in XL AIX/Linux?
Rvalue references N2118 12.1 (Superceded by N3290)
    Rvalue references for *this N2439  
Initialization of class objects by rvalues N1610 Superceded by N3290
Non-static data member initializers N2756  
Variadic templates N2242 11.1
    Extending variadic template template parameters N2555  
Initializer lists N2672 started in 13.1
Static assertions N1720 11.1
auto-typed variables N1984 11.1
    Multi-declarator auto N1737 11.1
    Removal of auto as a storage-class specifier N2546 11.1
    New function declarator syntax N2541 11.1
Lambda expressions N2927  
Declared type of an expression N2343 11.1
    Incomplete return types N3276  
Right angle brackets N1757 12.1
Default template arguments for function templates DR226 12.1 ptf
Solving the SFINAE problem for expressions DR339 8.0
Alias templates N2258  
Extern templates N1987 12.1
Null pointer constant N2431 13.1
Strongly-typed enums N2347 12.1
Forward declarations for enums N2764 
DR1206
12.1
Standardized attribute syntax N2761  
Generalized constant expressions N2235 12.1 (partial)
Alignment support N2341  
Conditionally-support behavior N1627  
Changing undefined behavior into diagnosable errors N1727  
Delegating constructors N1986 11.1
Inheriting constructors N2540  
Explicit conversion operators N2437 12.1
New character types N2249  
Unicode string literals N2442 10.1 (partial, only UTF16,32)
Raw string literals N2442  
Universal character names in literals N2170 7
User-defined literals N2765  
Standard Layout Types N2342  
Defaulted functions N2346 13.1
Deleted functions N2346 13.1
Extended friend declarations N1791 11.1
Extending sizeof N2253 
DR850
11.1
Inline namespaces N2535 11.1
Unrestricted unions N2544  
Local and unnamed types as template arguments N2657  
Range-based for N2930  
Explicit virtual overrides N2928 
N3206 
N3272
 
Minimal support for garbage collection and reachability-based leak detection N2670 N/A
Allowing move constructors to throw [noexcept] N3050  
Defining move special member functions N3053  
Concurrency
Sequence points N2239  
Atomic operations N2427  
Strong Compare and Exchange N2748  
Bidirectional Fences N2752  
Memory model N2429  
Data-dependency ordering: atomics and memory model N2664  
Propagating exceptions N2179  
Allow atomics use in signal handlers N2547  
Thread-local storage N2659 10.1 (partial, all except Std name and dynamic init)
Dynamic initialization and destruction with concurrency N2660  
C99 Features in C++11
__func__ predefined identifier N2340 8.0
C99 preprocessor N1653 10.1
long long N1811 10.1
Extended integral types N1988 N/A 

 

While we have started working on C++11 library, it will be delivered in future releases. On Linux, it will be similar to the GCC status when delivered since we use the GCC headers and library on the platform:

https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso

5 comments
0 views

Permalink

Comments

Mon November 25, 2013 10:06 AM

Originally posted by: Michael_Wong


C++11 Library is being worked on. As you can see, I added a comment to that in the latest update post for z/OS V2R1. The problem you are seeing is due to a macro in GNU library which makes sure it only works for GNU for a specific version. But even if you were to force define that macro, it would still fail because C++11 library requires C++11 feature support.

Wed April 17, 2013 08:14 PM

Originally posted by: AntonDaneyko


What about the standard library? Is it provided as well? Things like std::tuple and std::function? I am trying to compile (xlC tmp.cpp -qlanglvl=extended0x -std=c++0x) a little tuple example http://ideone.com/U5XeL1 using xlC 12.1 for Linux (for Blue Gene Q), but I get the following error: /long_path_with_gnu_in_it/c++0x_warning.h, line 31.2: 1540-0859 (S) #error directive: This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.. So it looks like I am using a GNU's standard library. Is there any way to get it working?

Mon July 30, 2012 04:36 PM

Originally posted by: Michael_Wong


Thanks for your comment and interest in lambdas. It is one of a long list of future feature that is part of C++11full compliance requirement. If you have a specific-need, please contact me directly for more direct update so I can rearrange priorities based on your specific requirement. Thanks.

Thu July 26, 2012 03:19 PM

Originally posted by: Kenji_Kindoh


When do you support lambda ?

Fri September 30, 2011 01:52 AM

Originally posted by: Zhipeng.Liu


Chinese Version of this blog: https://www.ibm.com/developerworks/mydeveloperworks/blogs/12bb75c9-dfec-42f5-8b55-b669cc56ad76/entry/xlc__e6_94_af_e6_8c_81_e7_9a_84c_11_e7_89_b9_e6_80_a77?lang=en