C++11 compatibility

Note: IBM supports selected features of C++11, known as C++0x before its ratification. IBM will continue to develop and implement the features of this standard. The implementation of the language level is based on IBM's interpretation of the standard. Until IBM's implementation of all the C++11 features is complete, including the support of a new C++11 standard library, the implementation may change from release to release. IBM makes no attempt to maintain compatibility, in source, binary, or listings and other compiler interfaces, with earlier releases of IBM's implementation of the new C++11 features.

The following features are part of a continual phased release process leading towards full compliance with C++11. They can be enabled by using the LANGLVL(EXTENDED0X) group option. You can also use specific compiler options to enable or disable these features. See the following table.

Table 1. Supported C++11 features
Language feature Discussed in: C++11 individual suboption control
Auto type deduction The auto type specifier (C++11)

LANGLVL([NO]AUTOTYPEDEDUCTION)

C99 long long Types of integer literals that are supported in C99 and C++11
LANGLVL([NO]C99LONGLONG),
IBM extension
LANGLVL([NO]EXTENDEDINTEGERSAFE)
C99 preprocessor features adopted in C++11 C99 preprocessor features adopted in C++11 (C++11)

LANGLVL([NO]C99PREPROCESSOR)

Decltype The decltype(expression) type specifier (C++11)

LANGLVL([NO]DECLTYPE)

Defaulted and deleted functions

Explicitly defaulted functions (C++11)

Deleted functions (C++11)

LANGLVL([NO]DEFAULTANDDELETE)

Delegating constructors Delegating constructors (C++11)

LANGLVL([NO]DELEGATINGCTORS)

Explicit conversion operators Explicit conversion operators (C++11)

LANGLVL([NO]EXPLICITCONVERSIONOPERATORS)

Explicit instantiation declarations Explicit instantiation declaration

LANGLVL([NO]EXTERNTEMPLATE)

Extended friend declarations Friends (C++ only)

LANGLVL([NO]EXTENDEDFRIEND)

Forward declaration of enumerations Enumerations N/A
Generalized constant expressions Generalized constant expressions (C++11)

LANGLVL([NO]CONSTEXPR)

Inline namespace definitions Inline namespace definitions (C++11)

LANGLVL([NO]INLINENAMESPACE)

Reference collapsing Reference collapsing (C++11)

LANGLVL([NO]REFERENCECOLLAPSING)

Right angle brackets Class templates (C++ only)

LANGLVL([NO]RIGHTANGLEBRACKET)

Rvalue references

Using rvalue reference (C++11) in z/OS XL C/C++ Programming Guide

LANGLVL([NO]RVALUEREFERENCES)

Scoped enumerations Enumerations

LANGLVL([NO]SCOPEDENUM)

static_assert static_assert declaration (C++11)

LANGLVL([NO]STATIC_ASSERT)

Trailing comma allowed in enum declarations Enumerations

LANGLVL([NO]TRAILENUM)

Trailing return type Trailing return type (C++11)

LANGLVL([NO]AUTOTYPEDEDUCTION)

Variadic templates Variadic templates (C++11)

LANGLVL([NO]VARIADIC[TEMPLATES])

Notes:
  • You can also use the LANGLVL(EXTENDED) group option to enable the explicit instantiation declarations feature.
  • If you try to use a C++11 feature when the feature is not enabled, the compiler issues an information message that follows a syntax error message. The information message indicates how to turn on the C++11 feature to recover from the syntax error. The involved C++11 features are listed as follows:
    • C99 preprocessor features adopted in C++11
      • Mixed string literal concatenation
      • The __STDC_HOSTED__ macro
    • Defaulted and deleted functions
    • Delegating constructors
    • Explicit conversion operators
    • Generalized constant expressions
    • Inline namespace definitions
    • nullptr
    • Reference collapsing
    • Right angle brackets
    • Rvalue references
    • Scoped enumerations
    • Variadic templates