Comeau C++ 4.0
Dialects and Modes
C++ Language Accepted
- C++ Dialect Accepted
The front end accepts the C++ language as defined by The Annotated
C++ Reference Manual (ARM) by Ellis and Stroustrup, Addison-Wesley,
1990, including templates, exceptions, and the anachronisms of
Chapter 18. Most features have been updated to match the specification
in the ANSI/ISO X3J16/WG21 Working Paper.
The front end also
has a cfront compatibility mode, which duplicates a number of
"features" and bugs of cfront 2.1 and 3.0.x. Complete
compatibility is not guaranteed or intended-the mode is there
to allow programmers who have used cfront features
to continue to compile their existing code. In particular, if
a program gets an error when compiled by cfront, the Comeau C++
4.0 front end may produce a different error or no error at all.
options are also available to enable and disable anachronisms
and strict standard-conformance checking.
- New Language Features Accepted
The following features not in the ARM but in the ANSI/ISO X3J16/WG21
Working Paper are accepted:
- 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 also in cases such as 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
- Qualification conversions such as conversion from T**
to T const * const * are allowe