Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8082986 | emb-9 | Jesper Wilhelmsson | P1 | Resolved | Fixed | team |
The barrier_set_cast function template is presently defined within the BarrierSet class, as a friend. (It needs access to a private helper metafunction defined in that class.)
For ordinary functions this shouldn't work; the ARM-specified friend injection was removed from the language pre-standardization. However, it seems that many compilers allow such injection when the friend is a template, and as a result the current implementation slipped through testing. This problem was first discovered by attempting to build with Xcode5 (OSX) and failing, while the official JDK9 OSX compiler is presently Xcode4, which accepts the code.
The fix is to change the in-class definition to merely a friend declaration and move the definition to namespace scope. See C++03 7.3.1.2 [namespace.memdef] clause 3 for details.
For ordinary functions this shouldn't work; the ARM-specified friend injection was removed from the language pre-standardization. However, it seems that many compilers allow such injection when the friend is a template, and as a result the current implementation slipped through testing. This problem was first discovered by attempting to build with Xcode5 (OSX) and failing, while the official JDK9 OSX compiler is presently Xcode4, which accepts the code.
The fix is to change the in-class definition to merely a friend declaration and move the definition to namespace scope. See C++03 7.3.1.2 [namespace.memdef] clause 3 for details.
- backported by
-
JDK-8082986 barrier_set_cast defined via friend injection
-
- Resolved
-
- is blocked by
-
JDK-8069016 Add BarrierSet downcast support
-
- Resolved
-