summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/uninitialized.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix -Wuninitialized to catch the case of a class being initialized with a callRichard Trieu2012-03-081-0/+2
| | | | | | to its own member function. llvm-svn: 152276
* Improvements to the uninitialized variable warning: Check if the constructorRafael Espindola2012-01-061-0/+1
| | | | | | | call is elidable or if the constructor is trivial instead of checking if it is user declared. llvm-svn: 147652
* Teach the CFG builder how to properly destroy temporaries whoDouglas Gregor2011-11-151-0/+27
| | | | | | | | lifetimes have been extended via reference binding. The type of the reference and the type of the temporary are not necessarily the same, which could cause a crash. Fixes <rdar://problem/10398199>. llvm-svn: 144646
* Change the self-reference visitor (which gives the warning for ↵Richard Trieu2011-09-071-0/+2
| | | | | | | | self-reference oninitalization warning of -Wuninitialized) to exclude member variables that can decay into pointers. This will cause it to no longer warn on this code: struct foo { char a[100], *e; } bar = { .e = bar.a }; llvm-svn: 139213
* Extend the self-reference warning to catch when a constructor references ↵Richard Trieu2011-09-011-0/+72
| | | | | | | | | itself upon initialization, such as using itself within its own copy constructor. struct S {}; S s(s); llvm-svn: 138969
* Fix PR9624 by explicitly disabling uninitialized warnings for direct self-init:Chandler Carruth2011-04-051-1/+1
| | | | | | | | | | | | | | | int x = x; GCC disables its warnings on this construct as a way of indicating that the programmer intentionally wants the variable to be uninitialized. Only the warning on the initializer is turned off in this iteration. This makes the code a lot more ugly, but starts commenting the surprising behavior here. This is a WIP, I want to refactor it substantially for clarity, and to determine whether subsequent warnings should be suppressed or not. llvm-svn: 128894
* Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with ↵Ted Kremenek2011-04-041-1/+1
| | | | | | | | | | | | | | numerous CFG and UninitializedValues analysis changes: 1) Change the CFG to include the DeclStmt for conditional variables, instead of using the condition itself as a faux DeclStmt. 2) Update ExprEngine (the static analyzer) to understand (1), so not to regress. 3) Update UninitializedValues.cpp to initialize all tracked variables to Uninitialized at the start of the function/method. 4) Only use the SelfReferenceChecker (SemaDecl.cpp) on global variables, leaving the dataflow analysis to handle other cases. The combination of (1) and (3) allows the dataflow-based -Wuninitialized to find self-init problems when the initializer contained control-flow. llvm-svn: 128858
* Add tests for the uninitialized checks added in r128376. Also clean upChandler Carruth2011-03-271-11/+42
| | | | | | | | | | | | | | | and flesh out the existing uninitialized testing for field initializers. The tests come from Richard's original patch, but I've cleaned them up a bit and ordered them more naturally. Also, I added a test for the most simple base case: int x = x; And it turns out we miss this one! =[ That and another bad FIXME on the field initializer checking are left in the test. llvm-svn: 128394
* Add test case for <rdar://problem/8610363> (a bogus report of using an ↵Ted Kremenek2010-10-301-0/+14
uninitialized field). This was already fixed, but this serves for detecting regressions. llvm-svn: 117754
OpenPOWER on IntegriCloud