aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/uninit-variables.cpp
AgeCommit message (Collapse)Author
2012-07-17-Wuninitialized: Split the classification of DeclRefExprs as initialization orRichard Smith
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160330 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15Modify how the -verify flag works. Currently, the verification string andRichard Trieu
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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146619 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-10Show either a location or a fixit note, not both, for uninitialized variable ↵David Blaikie
warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139463 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-08Fix another -Wuninitialized assertion failure (this one involving bit casts) ↵Ted Kremenek
resulting from the recent -Wuninitialized changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Fix assertion failure in -Wuninitialized involving no-op casts. Fixes PR 10577.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136939 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20Fix -Wuninitialized regression involving functions invalidating parameters ↵Ted Kremenek
passed by reference. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135610 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-13Teach -Wuninitialized about C++'s typeid expression, including both theChandler Carruth
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129431 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08Now that the analyzer is distinguishing between uninitialized uses thatChandler Carruth
definitely have a path leading to them, and possibly have a path leading to them; reflect that distinction in the warning text emitted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129126 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07Teach -Wuninitialized to not warn about variables declared in C++ catch ↵Ted Kremenek
statements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129102 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04-Wuninitialized: don't warn about uninitialized variables in unreachable code.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128840 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-29Add workaround for Sema issue found in <rdar://problem/9188004>, which leads ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128443 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-15Take 2: merge -Wuninitialized-experimental into -Wuninitialized. Only ↵Ted Kremenek
*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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127670 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07Move uninitialized variable checking back under ↵Ted Kremenek
-Wuninitialized-experimental. It is clear from user feedback that this warning is not quite ready. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125007 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05Don't suggest -Wuninitialized fixits for uninitialized enum types.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124924 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02Based on user feedback, swap -Wuninitialized diagnostics to have the warning ↵Ted Kremenek
refer to the bad use, and the note to the variable declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124758 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26Merge -Wuninitialized-experimental into -Wuninitialized.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124279 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21Provide -Wuninitialized-experimental fixitsTed Kremenek
for floats, and also check if 'nil' is declared when suggesting it for initializing ObjC pointers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124004 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21Enhance -Wuninitialized-experimental diagnosticsTed Kremenek
to issue the warning at an uninitialized variable's declaration, but to issue notes at possible uninitialized uses (which could be multiple). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123994 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20Relax CFG assertions in UninitializedValuesV2 whenTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123943 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18Teach UninitializedValuesV2 to implicitly reason about C++Ted Kremenek
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123777 91177308-0d34-0410-b5e6-96231b3b80d8