C++11 compatibility
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.
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), 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 | 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]) |
- 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
- C99 preprocessor features adopted in C++11