yaxunl added inline comments.

================
Comment at: lib/Sema/SemaChecking.cpp:3368-3374
   } else if (Form != Load && Form != LoadCopy) {
     if (ValType.isConstQualified()) {
       Diag(DRE->getLocStart(), diag::err_atomic_op_needs_non_const_pointer)
         << Ptr->getType() << Ptr->getSourceRange();
       return ExprError();
     }
   }
----------------
jfb wrote:
> rsmith wrote:
> > It would be a little nicer to change this `else if` to a plain `if` and 
> > conditionalize the diagnostic instead.
> > 
> > Can you track down whoever added the address space check to the C11 atomic 
> > path and ask them if they really meant for it to not apply to the GNU 
> > atomic builtins?
> It was @yaxunl in https://reviews.llvm.org/D28691
> Nobody asked about GNU atomic builtins with OpenCL in that review. I'll let 
> @yaxunl chime in.
Your change LGTM. Originally the check for constant addr space was introduced 
to match the check of C11 for const. OpenCL itself does not have this 
restriction.


Repository:
  rC Clang

https://reviews.llvm.org/D47618



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to