[PATCH] D37529: [codeview] omit debug locations for nested exprs unless column info enabled

Bob Haarman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 15:09:57 PDT 2017


inglorion added inline comments.


================
Comment at: clang/lib/CodeGen/CGStmt.cpp:45
+  }
+  return IDL;
+}
----------------
inglorion wrote:
> rnk wrote:
> > Does MSVC accept this? I think it will emit the copy ctor call in an -O0 build.
> I wrote this thinking that the right thing would happen under copy elision (there is only one object, move constructor isn't called, and the destructor only runs once) and without copy elision (there are two objects, move constructor is called, destructor is run for both objects but is a no-op for the moved-from object). If that's not the case, how would you rewrite this to do the right thing?
FWIW, the test passes with MSVC in a Debug build, too.


https://reviews.llvm.org/D37529





More information about the cfe-commits mailing list