\begin{cppspecific}[4ex] \section{C++ Reference in Data-Sharing Clauses} \label{sec:cpp_reference} \index{clauses!data-sharing, C++ reference in} \index{data-sharing clauses, C++ reference in} C++ reference types are allowed in data-sharing attribute clauses as of OpenMP 4.5, except for the \kcode{threadprivate}, \kcode{copyin} and \kcode{copyprivate} clauses. (See the \docref{Data-Sharing Attribute Clauses} section of the 4.5 OpenMP specification.) When a variable with C++ reference type is privatized, the object the reference refers to is privatized in addition to the reference itself. The following example shows the use of reference types in data-sharing clauses in the usual way. Additionally it shows how the data-sharing of formal arguments with a C++ reference type on an orphaned task generating construct is determined implicitly. (See the \docref{Data-sharing Attribute Rules for Variables Referenced in a Construct} section of the 4.5 OpenMP specification.) \cppnexample[4.5]{cpp_reference}{1} \end{cppspecific}