summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/pr40771-ctad-with-lambda-copy-capture.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert "CodeGen: ensure placeholder instruction for cleanup is created""Saleem Abdulrasool2019-07-251-0/+55
| | | | | | | | | This reverts commit fd1274fa78cb0fd32cc1fa2e6f5bb8e62d29df19. Add an explicit triple for the test which is pattern matching overly aggressively. llvm-svn: 367055
* Revert "CodeGen: ensure placeholder instruction for cleanup is created"JF Bastien2019-07-251-56/+0
| | | | | | | | | | | | | | | | | | | | | Originally in https://reviews.llvm.org/D64656 Causes bot failures: /home/buildslave/buildslave/clang-cmake-armv8-full/llvm/tools/clang/test/CodeGenCXX/pr40771-ctad-with-lambda-copy-capture.cpp:20:16: error: CHECK-NEXT: expected string not found in input // CHECK-NEXT: call void @_ZN1RC1E1Q(%struct.R* [[TMP_R]]) ^ <stdin>:37:2: note: scanning from here %8 = call %struct.R* @_ZN1RC1E1Q(%struct.R* %1) ^ <stdin>:37:2: note: with "TMP_R" equal to "%1" %8 = call %struct.R* @_ZN1RC1E1Q(%struct.R* %1) ^ <stdin>:37:17: note: possible intended match here %8 = call %struct.R* @_ZN1RC1E1Q(%struct.R* %1) ^ llvm-svn: 367051
* CodeGen: ensure placeholder instruction for cleanup is createdSaleem Abdulrasool2019-07-251-0/+56
A placeholder instruction for use in generation of cleanup code for an initializer list would not be emitted if the base class contained a non-trivial destructor and the class contains no fields of its own. This would be the case when using CTAD to deduce the template arguments for a struct with an overloaded call operator, e.g. ``` template <class... Ts> struct ctad : Ts... {}; template <class... Ts> ctad(Ts...)->ctad<Ts...>; ``` and this class was initialized with a list of lambdas capturing by copy, e.g. ``` ctad c {[s](short){}, [s](long){}}; ``` In a release build the bug would manifest itself as a crash in the SROA pass, however, in a debug build the following assert in CGCleanup.cpp would fail: ``` assert(dominatingIP && "no existing variable and no dominating IP!"); ``` By ensuring that a placeholder instruction is emitted even if there's no fields in the class, neither the assert nor the crash is reproducible. See https://bugs.llvm.org/show_bug.cgi?id=40771 Patch by Øystein Dale! llvm-svn: 367042
OpenPOWER on IntegriCloud