https://bugs.llvm.org/show_bug.cgi?id=33065

Michael Matz <m...@suse.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---
                 CC|                            |m...@suse.de

--- Comment #7 from Michael Matz <m...@suse.de> ---
(In reply to James Y Knight from comment #5)
> The standard says (C11 section 6.7.9 para 23):
> 
> > The evaluations of the initialization list expressions are indeterminately 
> > sequenced with respect to one another and thus the order in which any side 
> > effects occur is unspecified.152)
> 
> > 152) In particular, the evaluation order need not be the same as the order 
> > of subobject initialization
> 
> 
> This is independent of the "6.7.8 par 19" quoted (which is now 6.7.9 para 19)

While I agree this could be read that way (though I find that overly aggressive
reading), the rest is wrong.  First:

> Further, there is not a sequence point between these, as an initializer in a
> compound literal is not a "full expression".

This is no compound literal, it's an initializer.

And second:

> "Full expression" does actually
> (perhaps surprisingly) seem to mean what it sounds like it should.
>
> From C11 6.8 para 4: 
> > A full expression is an expression that is not part of another expression 
> > or of a declarator.

While the citation is of course correct, it doesn't apply here.  The
initializer
is not part of a declarator (it is part of a declaration; expressions in
declarators are things like array sizes). Hence the expressions in the
initializer-list are full expressions (as they clearly aren't part of other
expressions either), and so the sequence point rule
between full expressions applies and clangs warning is wrong.

Reopening because of this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to