[cfe-dev] [RFC] Should an illegal C++11 memory model in an atomic op be an error?

Reid Kleckner rnk at google.com
Mon Feb 2 13:43:25 PST 2015


On Mon, Feb 2, 2015 at 1:27 PM, Tim Northover <tnorthover at apple.com> wrote:

> Hi Sean,
>
> > Tim, could you shed a bit more light on the context of this patch in
> rdar://problem/16242991 ?
>
> There's not really any more context: the original bug was asking for some
> diagnostic, I decided it had to be a warning because legitimate C code can
> (statically) contain calls like that. It's most likely to come up with
> macro or template expansion of course.
>

I'd be in favor or promoting it to an error. We recently started rejecting
this code, for example:

void f(int n) {
  if (__builtin_constant_p(n))
    __asm__("" : : "I"(n));
  else
    __asm__("" : : "m"(n));
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150202/1567d53d/attachment.html>


More information about the cfe-dev mailing list