summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/uninit-variables.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PR19996: don't crash if -Wuninitialized sees a c++1y lambda init-capture.Richard Smith2014-06-111-1/+4
| | | | llvm-svn: 210615
* -Wuninitialized: Split the classification of DeclRefExprs as initialization orRichard Smith2012-07-171-0/+6
| | | | | | | | | | use out of TransferFunctions, and compute it in advance rather than on-the-fly. This allows us to handle compound assignments with DeclRefExprs on the RHS correctly, and also makes it trivial to treat const& function parameters as not initializing the argument. The patch also makes both of those changes. llvm-svn: 160330
* Modify how the -verify flag works. Currently, the verification string andRichard Trieu2011-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) llvm-svn: 146619
* Show either a location or a fixit note, not both, for uninitialized variable ↵David Blaikie2011-09-101-4/+4
| | | | | | warnings. llvm-svn: 139463
* Fix another -Wuninitialized assertion failure (this one involving bit casts) ↵Ted Kremenek2011-08-081-0/+11
| | | | | | resulting from the recent -Wuninitialized changes. llvm-svn: 137068
* Fix assertion failure in -Wuninitialized involving no-op casts. Fixes PR 10577.Ted Kremenek2011-08-041-0/+11
| | | | llvm-svn: 136939
* Fix -Wuninitialized regression involving functions invalidating parameters ↵Ted Kremenek2011-07-201-0/+10
| | | | | | passed by reference. llvm-svn: 135610
* Teach -Wuninitialized about C++'s typeid expression, including both theChandler Carruth2011-04-131-0/+17
| | | | | | | | | | | evaluated and unevaluated contexts. Add some testing of sizeof and typeid. Both of the typeid tests added here were triggering warnings previously. Now the one false positive is suppressed without suppressing the warning on actually buggy code. llvm-svn: 129431
* Now that the analyzer is distinguishing between uninitialized uses thatChandler Carruth2011-04-081-2/+2
| | | | | | | definitely have a path leading to them, and possibly have a path leading to them; reflect that distinction in the warning text emitted. llvm-svn: 129126
* Teach -Wuninitialized to not warn about variables declared in C++ catch ↵Ted Kremenek2011-04-071-0/+14
| | | | | | statements. llvm-svn: 129102
* -Wuninitialized: don't warn about uninitialized variables in unreachable code.Ted Kremenek2011-04-041-0/+8
| | | | llvm-svn: 128840
* Add workaround for Sema issue found in <rdar://problem/9188004>, which leads ↵Ted Kremenek2011-03-291-1/+22
| | | | | | | | | to an assertion failure in the uninitialized variables analysis. The problem is that Sema isn't properly registering a variable in a DeclContext (which -Wuninitialized relies on), but my expertise on the template instantiation logic isn't good enough to fix this problem for real. This patch worksaround the problem in -Wuninitialized, but we should fix it for real later. llvm-svn: 128443
* Take 2: merge -Wuninitialized-experimental into -Wuninitialized. Only ↵Ted Kremenek2011-03-151-1/+1
| | | | | | *must-be-uninitialized* warnings are reported, with *maybe-uninitialized* under a separate flag. I await any fallout/comments/feedback, although hopefully this will produce no noise for users. llvm-svn: 127670
* Move uninitialized variable checking back under ↵Ted Kremenek2011-02-071-1/+1
| | | | | | -Wuninitialized-experimental. It is clear from user feedback that this warning is not quite ready. llvm-svn: 125007
* Don't suggest -Wuninitialized fixits for uninitialized enum types.Ted Kremenek2011-02-051-0/+8
| | | | llvm-svn: 124924
* Based on user feedback, swap -Wuninitialized diagnostics to have the warning ↵Ted Kremenek2011-02-021-2/+2
| | | | | | refer to the bad use, and the note to the variable declaration. llvm-svn: 124758
* Merge -Wuninitialized-experimental into -Wuninitialized.Ted Kremenek2011-01-261-1/+1
| | | | llvm-svn: 124279
* Provide -Wuninitialized-experimental fixitsTed Kremenek2011-01-211-1/+1
| | | | | | | for floats, and also check if 'nil' is declared when suggesting it for initializing ObjC pointers. llvm-svn: 124004
* Enhance -Wuninitialized-experimental diagnosticsTed Kremenek2011-01-211-2/+2
| | | | | | | | to issue the warning at an uninitialized variable's declaration, but to issue notes at possible uninitialized uses (which could be multiple). llvm-svn: 123994
* Relax CFG assertions in UninitializedValuesV2 whenTed Kremenek2011-01-201-0/+28
| | | | | | | | | | | handling pseudo-path sensitivity, and instead use those assertion conditions as dynamic checks. These assertions would be violated when analyzing a CFG where some branches where optimized away during CFG construction because their branch conditions could be trivially determined. llvm-svn: 123943
* Teach UninitializedValuesV2 to implicitly reason about C++Ted Kremenek2011-01-181-0/+15
references by monitoring whether an access to a variable is solely to compute it's lvalue or to do an lvalue-to-rvalue conversion (i.e., a load). llvm-svn: 123777
OpenPOWER on IntegriCloud