summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/pr18962.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CodeGen: Don't crash when initializing pointer-to-member fields in basesDavid Majnemer2014-09-281-1/+1
| | | | | | | | | | | | | | | | | Clang uses two types to talk about a C++ class, the NonVirtualBaseLLVMType and the LLVMType. Previously, we would allow one of these to be packed and the other not. This is problematic. If both don't agree on a common subset of fields, then routines like getLLVMFieldNo will point to the wrong field. Solve this by copying the 'packed'-ness of the complete type to the non-virtual subobject. For this to work, we need to take into account the non-virtual subobject's size and alignment when we are computing the layout of the complete object. This fixes PR21089. llvm-svn: 218577
* Fix testcase for PR18962 with an explicit tripleReid Kleckner2014-02-271-1/+1
| | | | llvm-svn: 202324
* PR18962: Fix "Unable to find record layout information for type"Reid Kleckner2014-02-271-0/+32
Clang is using llvm::StructType::isOpaque() as a way of signaling if we've finished record type conversion in CodeGenTypes::isRecordLayoutComplete(). However, Clang was setting the body of the type before it finished laying out the type as a base type. Laying out the %class.C.base LLVM type attempts to convert more types, eventually recursively attempting to layout 'C' again, at which point we would say that layout was complete, even though we were still in the middle of it. By not setting the body, we correctly signal that layout is not complete, and things work as expected. At some point, it might be worth refactoring this to avoid looking at the LLVM IR types under construction. llvm-svn: 202320
OpenPOWER on IntegriCloud