summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/constexpr-value-init.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PR12012: Fix a regression in r150419 where we would try (and fail) toRichard Smith2012-02-171-0/+6
| | | | | | | zero-initialize class types with virtual bases when constant-evaluating an initializer. llvm-svn: 150770
* Update constexpr implementation to match CWG's chosen approach for core issuesRichard Smith2012-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | 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-0/+31
| | | | | | | | | | | | 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-31/+0
| | | | llvm-svn: 147362
* constexpr: perform zero-initialization prior to / instead of performing aRichard Smith2011-12-251-0/+31
constructor call when appropriate. Thanks to Eli for spotting this. llvm-svn: 147271
OpenPOWER on IntegriCloud