Loading... (original) (raw)

From: http://docs.oracle.com/cd/E37069_01/html/E37075/gnyjb.html#OSSCPgnyly

"When a friend declaration in class C for a function or class T was the first declaration of T, previous compilers incorrectly inserted the declaration of T into the surrounding scope. The Oracle Solaris Studio 12.4 C++ 5.13 compiler no longer does so, because it can lead to incorrect interpretation of valid programs."

An example of this change in behavior for Hotspot first shows up as an C++ error diagnostic in src/share/vm/adlc/filebuff.hpp

"/src/share/vm/adlc/filebuff.hpp", line 107: Error: Unqualified name '<<' in friend declaration is looked up in the nearest enclosing namespace and does not refer to existing '::std::operator<<<_charT, _Traits>(basic_ostream<_charT, _Traits>&, _charT)'.
1 Error(s) detected.

All friend declarations will have to be examined and potentially changed before using Solaris C++ 5.13.