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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits