[PATCH] D72212: [Sema] Improve -Wrange-loop-analysis warnings

Mark de Wever via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 5 05:15:53 PST 2020


Mordante marked 3 inline comments as done.
Mordante added inline comments.


================
Comment at: clang/lib/Sema/SemaStmt.cpp:2806
-  // constructors.
-  if (VariableType.isPODType(SemaRef.Context))
     return;
----------------
xbolva00 wrote:
> Mordante wrote:
> > xbolva00 wrote:
> > > assert it?
> > Sorry I don't understand what you mean. What do you want to assert?
> if (isTriviallyCopyableType) {
>      assert(isPOD);
> }
> 
> But probably not very useful to have an assert here.
That will not work. Every POD type is TriviallyCopyable, but not every TriviallyCopyable type is a POD type.

In the tests I have separate tests for POD types and TriviallyCopyable types.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72212/new/

https://reviews.llvm.org/D72212





More information about the cfe-commits mailing list