Comeau C++ 4.0
Dialects and Modes
C++ Language Accepted
  1. 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.

    Command-line options are also available to enable and disable anachronisms and strict standard-conformance checking.

  2. New Language Features Accepted

    The following features not in the ARM but in the ANSI/ISO X3J16/WG21 Working Paper are accepted:

    1. 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.

    2. 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.

    3. Qualified names are allowed in elaborated type specifiers.

    4. A global-scope qualifier is allowed in member references of the form x.::A::B and also in cases such as p->::A::B.

    5. The precedence of the third operand of the "?" operator is changed.

    6. 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.

    7. Pointers to arrays with unknown bounds as parameter types are diagnosed as errors.

    8. 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.

    9. A cast can be used to select one out of a set of overloaded functions when taking the address of a function.

    10. Template friend declarations and definitions are permitted in class definitions and class template definitions.

    11. Type template parameters are permitted to have default arguments.

    12. Function templates may have nontype template parameters.

    13. A reference to const volatile cannot be bound to an rvalue.

    14. Qualification conversions such as conversion from T** to T const * const * are allowe