RFR (S) JDK-8041620: Solaris Studio 12.4 C++ 5.13 change in behavior for placing friend declarations within surrounding scope
lois.foltan at oracle.com
Mon May 5 13:15:26 UTC 2014
On 5/4/2014 4:20 PM, David Holmes wrote:
> Hi Lois,
> Deletion of FileBuffRegion looks okay to me.
> Otherwise would the fix have been to change
> friend ostream& operator<< (ostream&, FileBuffRegion&);
> friend ostream& ::std::operator<< (ostream&, FileBuffRegion&);
Thanks for the review. Volker Simonis' follow on email provides an
example of how this would be fixed if the code was not being removed.
The friend function would need to be declared in the outer scope prior
to the class declaration.
> On 5/05/2014 5:13 AM, Lois Foltan wrote:
>> Please review the following fix:
>> Bug: Solaris Studio 12.4 C++ 5.13 change in behavior for placing friend
>> declarations within surrounding scope
>> Solaris Studio 12.4 C++ 5.13 compiler generates the following warning
>> level compilation diagnostic for
>> "<directory>/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>&,
>> 1 Error(s) detected.
>> C++ 5.13 external beta documentation at
>> details this change in behavior for friend declarations. Thank you to
>> Christian Thalinger for pointing out that
>> within filebuff.hpp, class FileBuffRegion is no longer used. Instead of
>> fixing the friend declaration in unused code,
>> removing FileBuffRegion.
>> JPRT build & test, Hotspot's JTREG test system, vm.quick.testlist
More information about the hotspot-compiler-dev