PR22877: When constructing an array via a constructor with a default argument
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 11 May 2017 18:58:24 +0000 (18:58 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 11 May 2017 18:58:24 +0000 (18:58 +0000)
commit722363727d2953f62b5ccbf90da4218054583961
treebff3a47f4fbfe1e7b7e2a0a5903c649a2a13973a
parentdbd6219f8197c2b95b33e7a83d02d87721eff649
PR22877: When constructing an array via a constructor with a default argument
in list-initialization, run cleanups for the default argument after each
iteration of the initialization loop.

We previously only ran the destructor for any temporary once, at the end of the
complete loop, rather than once per iteration!

Re-commit of r302750, reverted in r302776.

llvm-svn: 302817
clang/lib/CodeGen/CGExprAgg.cpp
clang/test/CodeGenCXX/array-default-argument.cpp [new file with mode: 0644]