Reject uses of the default new/delete operators with a diagnostic
instead of a crash in OpenCL C++ mode and accept user-defined forms.
Details
Diff Detail
Event Timeline
lib/Sema/SemaExprCXX.cpp | ||
---|---|---|
2030 | I think a better interpretation of this rule would be to just error on attempts to use the standard non-placement operator new/delete instead of trying to outlaw the operator declarations. For example, I don't know why a user-defined non-global operator new would be problematic. |
lib/Sema/SemaExprCXX.cpp | ||
---|---|---|
2030 | Good point, I have raised this with Khronos, so I will hold this off until we have clarification. |
lib/Sema/SemaExprCXX.cpp | ||
---|---|---|
2030 | The decision by Khronos is to allow all user defined new/delete operators (even global). I have submitted the change to the spec. The next publishing date is however in July. |
lib/Sema/SemaDeclCXX.cpp | ||
---|---|---|
13010 | getTypePtr() is done automatically by operator-> on QualType. This can be fixed in multiple places in this patch. | |
lib/Sema/SemaExprCXX.cpp | ||
2030 | Okay. I agree with your decision in this patch to treat this as a defect in the spec and thus to go ahead and do the right thing now. |
lib/Sema/SemaExprCXX.cpp | ||
---|---|---|
2030 | I can postpone committing this until the revised spec has been published, if that's more desirable? |
LGTM.
lib/Sema/SemaExprCXX.cpp | ||
---|---|---|
2030 | No, if that's the directive I see no reason to wait for formal publication. As precedent, we update C++ rules long before ISO officially blesses the current draft into a standard. |
getTypePtr() is done automatically by operator-> on QualType. This can be fixed in multiple places in this patch.