2.2.1. Standard Language Features Accepted. Altium TriCore
விளம்பரம்
விளம்பரம்
TASKING VX-toolset for TriCore User Guide
2.2.1. Standard Language Features Accepted
The following features not in traditional C++ (the C++ language of "The Annotated C++ Reference Manual" by Ellis and Stroustrup (ARM)) but in the standard are implemented:
• The dependent statement of an if
, while
, do-while
, or for
is considered to be a scope, and the restriction on having such a dependent statement be a declaration is removed.
• The expression tested in an if
, while
, do-while
, or for
, as the first operand of a "
?
" operator, or as an operand of the "
&&
", "
:
", or "
!
"operators may have a pointer-to-member type or a class type that can be converted to a pointer-to-member type in addition to the scalar cases permitted by the ARM.
• Qualified names are allowed in elaborated type specifiers.
• A global-scope qualifier is allowed in member references of the form x.::A::B
and p->::A::B
.
• The precedence of the third operand of the "
?
" operator is changed.
• If control reaches the end of the main()
routine, and main()
has an integral return type, it is treated as if a return 0;
statement were executed.
• Pointers to arrays with unknown bounds as parameter types are diagnosed as errors.
• A functional-notation cast of the form
A()
can be used even if
A
is a class without a (nontrivial) constructor. The temporary created gets the same default initialization to zero as a static object of the class type.
• A cast can be used to select one out of a set of overloaded functions when taking the address of a function.
• Template friend declarations and definitions are permitted in class definitions and class template definitions.
• Type template parameters are permitted to have default arguments.
• Function templates may have nontype template parameters.
• A reference to const volatile
cannot be bound to an rvalue.
• Qualification conversions, such as conversion from
T**
to
T const * const *
are allowed.
• Digraphs are recognized.
• Operator keywords (e.g., not
, and
, bitand
, etc.) are recognized.
• Static data member declarations can be used to declare member constants.
• When option --wchar_t-keyword
is set, wchar_t
is recognized as a keyword and a distinct type.
• bool
is recognized.
• RTTI (run-time type identification), including dynamic_cast
and the typeid
operator, is implemented.
48
C++ Language
• Declarations in tested conditions (in if
, switch
, for
, and while
statements) are supported.
• Array new
and delete
are implemented.
• New-style casts ( static_cast
, reinterpret_cast
, and const_cast
) are implemented.
• Definition of a nested class outside its enclosing class is allowed.
• mutable
is accepted on non-static data member declarations.
• Namespaces are implemented, including using
declarations and directives. Access declarations are broadened to match the corresponding using
declarations.
• Explicit instantiation of templates is implemented.
• The typename
keyword is recognized.
• explicit
is accepted to declare non-converting constructors.
• The scope of a variable declared in the for-init-statement
of a for
loop is the scope of the loop
(not the surrounding scope).
• Member templates are implemented.
• The new specialization syntax (using " template <>
") is implemented.
• Cv-qualifiers are retained on rvalues (in particular, on function return values).
• The distinction between trivial and nontrivial constructors has been implemented, as has the distinction between PODs and non-PODs with trivial constructors.
• The linkage specification is treated as part of the function type (affecting function overloading and implicit conversions).
• extern inline
functions are supported, and the default linkage for inline
functions is external.
• A typedef name may be used in an explicit destructor call.
• Placement delete is implemented.
• An array allocated via a placement new can be deallocated via delete.
• Covariant return types on overriding virtual functions are supported.
• enum
types are considered to be non-integral types.
• Partial specialization of class templates is implemented.
• Partial ordering of function templates is implemented.
• Function declarations that match a function template are regarded as independent functions, not as
"guiding declarations" that are instances of the template.
• It is possible to overload operators using functions that take enum
types and no class
types.
49
TASKING VX-toolset for TriCore User Guide
• Explicit specification of function template arguments is supported.
• Unnamed template parameters are supported.
• The new lookup rules for member references of the form x.A::B
and p->A::B
are supported.
• The notation
:: template
(and
->template
, etc.) is supported.
• In a reference of the form f()->g()
, with g
a static member function, f()
is evaluated. The ARM specifies that the left operand is not evaluated in such cases.
• enum
types can contain values larger than can be contained in an int
.
• Default arguments of function templates and member functions of class templates are instantiated only when the default argument is used in a call.
• String literals and wide string literals have const
type.
• Class name injection is implemented.
• Argument-dependent (Koenig) lookup of function names is implemented.
• Class and function names declared only in unqualified friend declarations are not visible except for functions found by argument-dependent lookup.
• A void
expression can be specified on a return statement in a void
function.
• Function-try-blocks, i.e., try-blocks that are the top-level statements of functions, constructors, or destructors, are implemented.
• Universal character set escapes (e.g.,
\uabcd
) are implemented.
• On a call in which the expression to the left of the opening parenthesis has class type, overload resolution looks for conversion functions that can convert the class object to pointer-to-function types, and each such pointed-to "surrogate function" type is evaluated alongside any other candidate functions.
• Dependent name lookup in templates is implemented. Nondependent names are looked up only in the context of the template definition. Dependent names are also looked up in the instantiation context, via argument-dependent lookup.
• Value-initialization is implemented. This form of initialization is indicated by an initializer of "()" and causes zeroing of certain POD-typed members, where the usual default-initialization would leave them uninitialized.
• A partial specialization of a class member template cannot be added outside of the class definition.
• Qualification conversions may be performed as part of the template argument deduction process.
• The export
keyword for templates is implemented.
50
பதிவிறக்கு
விளம்பரம்