summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/special/class.ctor/p6-0x.cpp
Commit message (Collapse)AuthorAgeFilesLines
* A union can have a constexpr defaulted default constructor, if it has anRichard Smith2012-05-071-0/+39
| | | | | | | | | in-class initializer for one of its fields. Value-initialization of such a type should use the in-class initializer! The former was just a bug, the latter is a (reported) standard defect. llvm-svn: 156274
* Update constexpr implementation to match CWG's chosen approach for core issuesRichard Smith2012-02-131-3/+3
| | | | | | | | | | | | | | | | | | | | 1358, 1360, 1452 and 1453. - Instantiations of constexpr functions are always constexpr. This removes the need for separate declaration/definition checking, which is now gone. - This makes it possible for a constexpr function to be virtual, if they are only dependently virtual. Virtual calls to such functions are not constant expressions. - Likewise, it's now possible for a literal type to have virtual base classes. A constexpr constructor for such a type cannot actually produce a constant expression, though, so add a special-case diagnostic for a constructor call to such a type rather than trying to evaluate it. - Classes with trivial default constructors (for which value initialization can produce a fully-initialized value) are considered literal types. - Classes with volatile members are not literal types. - constexpr constructors can be members of non-literal types. We do not yet use static initialization for global objects constructed in this way. llvm-svn: 150359
* Unrevert r147271, reverted in r147361.Richard Smith2011-12-301-2/+10
| | | | | | | | | | | | Also temporarily remove the assumption from IR gen that we can emit IR for every constant we can fold, since it isn't currently true in C++11, to fix PR11676. Original comment from r147271: constexpr: perform zero-initialization prior to / instead of performing a constructor call when appropriate. Thanks to Eli for spotting this. llvm-svn: 147384
* Revert r147271. This fixes PR11676.Rafael Espindola2011-12-301-10/+2
| | | | llvm-svn: 147362
* constexpr: perform zero-initialization prior to / instead of performing aRichard Smith2011-12-251-2/+10
| | | | | | constructor call when appropriate. Thanks to Eli for spotting this. llvm-svn: 147271
* PR11614: Mark defaulted special constructors as constexpr if their implicitRichard Smith2011-12-221-0/+49
definition would satisfy the constexpr requirements. llvm-svn: 147128
OpenPOWER on IntegriCloud