29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Language Extensions<br />

3.5 Standard C++ language extensions<br />

The compiler supports numerous extensions to the ISO C++ standard, for example,<br />

qualified names in the declaration of class members.<br />

These extensions are available if the source language is C++ and you are compiling in<br />

non strict mode.<br />

These extensions are not available if the source language is C++ and the compiler is<br />

restricted to compiling strict Standard C++ using the --strict compiler option.<br />

3.5.1 operator<br />

A operator whose second and third operands are string literals or wide string literals<br />

can be implicitly converted to char * or wchar_t *. In C++ string literals are const. There<br />

is an implicit conversion that enables conversion of a string literal to char * or wchar_t<br />

*, dropping the const. That conversion, however, applies only to simple string literals.<br />

Permitting it for the result of a operation is an extension.<br />

Example<br />

char *p = x "abc" : "def";<br />

3.5.2 Declaration of a class member<br />

A qualified name can be used in the declaration of a class member.<br />

Errors<br />

A warning is issued if a qualified name is used in the declaration of a class member.<br />

Example<br />

struct A<br />

{<br />

int A::f(); // is the same as int f();<br />

};<br />

3.5.3 friend<br />

A friend declaration for a class can omit the class keyword.<br />

Access checks are not carried out on friend declarations by default. Use the --strict<br />

command-line option to force access checking.<br />

<strong>ARM</strong> DUI 0348A Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. 3-15<br />

Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!