summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-global-constructors.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Unnamed bitfields don't block constant evaluation of constexpr ctorsJordan Rose2017-10-241-0/+19
| | | | | | | | | | | | | | | | | | | | | | | C++14 [dcl.constexpr]p4 states that in the body of a constexpr constructor, > every non-variant non-static data member and base class sub-object shall be initialized However, [class.bit]p2 notes that > Unnamed bit-fields are not members and cannot be initialized. Therefore, we should make sure to filter them out of the check that all fields are initialized. Fixing this makes the constant evaluator a bit smarter, and specifically allows constexpr constructors to avoid tripping -Wglobal-constructors when the type contains unnamed bitfields. Reviewed at https://reviews.llvm.org/D39035. llvm-svn: 316408
* Add a missing Invalid check to SubobjectDesignator::isOnePastEnd()Reid Kleckner2014-07-231-0/+6
| | | | | | | | | | | The class seems to have an invariant that Entries is non-empty if Invalid is false. It appears this method was previously private, and all internal uses checked Invalid. Now there is an external caller, so check Invalid to avoid array OOB underflow. Fixes PR20420. llvm-svn: 213816
* Don't emit exit-time destructor warnings for trivial explicitly defaulted dtorsStephan Tolksdorf2014-03-271-1/+12
| | | | | | | | This commit also adds an additional test case for the global destructor warning. Reviewed in http://llvm-reviews.chandlerc.com/D3205 llvm-svn: 204954
* -Wglobal-constructors: Don't warn on trivial defaulted dtorsReid Kleckner2014-03-261-1/+9
| | | | | | Fixes PR19253. llvm-svn: 204825
* Make Expr::isConstantInitializer match IRGen.Eli Friedman2013-07-161-0/+6
| | | | | | | | | | Sema needs to be able to accurately determine what will be emitted as a constant initializer and what will not, so we get accurate errors in C and accurate -Wglobal-constructors warnings in C++. This makes Expr::isConstantInitializer match CGExprConstant as closely as possible. llvm-svn: 186464
* PR9669: implement correct checking for [dcl.init.string]p2.Eli Friedman2011-04-111-2/+2
| | | | llvm-svn: 129260
* static local variables with destructors don't require a global destructorJohn McCall2010-09-181-2/+8
| | | | | | | | | unless we're on a platform without __cxa_atexit (or use thereof has been disabled). This patch actually just disables the check completely for static locals, but I've filed http://llvm.org/bugs/show_bug.cgi?id=8176 to track the platform-specific fix. llvm-svn: 114269
* one piece of code is responsible for the lifetime of every aggregateJohn McCall2010-09-151-2/+2
| | | | | | | | | | | | | slot. The easiest way to do that was to bundle up the information we care about for aggregate slots into a new structure which demands that its creators at least consider the question. I could probably be convinced that the ObjC 'needs GC' bit should be rolled into this structure. Implement generalized copy elision. The main obstacle here is that IR-generation must be much more careful about making sure that exactly llvm-svn: 113962
* Don't give 'global constructor' warnings for function statics, even if they ↵Sebastian Redl2010-09-081-1/+11
| | | | | | have a direct initializer. Fixes PR8095. llvm-svn: 113344
* Static local variables don't result in global constructors being emitted.Anders Carlsson2010-09-031-0/+23
| | | | llvm-svn: 112933
* Further adjustments to -Wglobal-constructors; works for references and directJohn McCall2010-08-021-8/+11
| | | | | | initializations now. llvm-svn: 110063
* Kill off RequiresGlobalConstructor in favor of isConstantInitializer.John McCall2010-08-011-0/+16
| | | | | | Note some obvious false positives in the test case. llvm-svn: 109986
* Make a first pass at implementing -Wglobal-constructors. I'm worried that thisJohn McCall2010-08-011-0/+39
will end up bizarrely mirroring CGExprConstant, but that might be the hazard of this feature. llvm-svn: 109984
OpenPOWER on IntegriCloud