Skip to content

Commit 02142f3

Browse files
AnastasiaStulovamantogninisvenvh
authored
[C++ for OpenCL] Lift restriction on reference members w local objects (#509)
* [C++ for OpenCL] Lift restriction on reference members for __local objects. Co-authored-by: Marco Antognini <antognini.marco@gmail.com> Co-authored-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
1 parent f093899 commit 02142f3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

cxx4opencl/address_spaces.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,11 @@ created in the local address space have undefined state at the point of
342342
their declaration. Developers are free to define a special member function
343343
that can initialize local address space objects after their declaration. Any
344344
default values provided for the initialization of members in a class
345-
declaration are ignored when creating the local address space objects.
346-
Classes that are instantiated with local address space objects can not
347-
have references as their members. The same restriction applies recursively
348-
to the members and base classes. Destructors of local address space objects
349-
are not invoked automatically. They can be called manually if required.
345+
declaration are ignored when creating the local address space objects. Since
346+
the initialization is performed after the variable declaration, special handling
347+
is required for classes with data members that are references because their values
348+
can not be overwritten trivially. Destructors of local address space objects
349+
are not invoked automatically. They can be called manually.
350350

351351
User defined constructors are not allowed to construct objects in `__constant`
352352
address space. Such objects can be initialized using literals and

0 commit comments

Comments
 (0)