History log of /external/clang/test/SemaCXX/uninitialized.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5965b7c7ddf8d9635426943a05441c71cb59fef6 20-Aug-2012 Hans Wennborg <hans@hanshq.net> Better wording for reference self-initialization warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
8be9e77f7e532866fa0ef2bc8c3cd549f0cc8da2 17-Aug-2012 Hans Wennborg <hans@hanshq.net> Warn about self-initialization of references.

Initializing a reference with itself, e.g. "int &a = a;" seems like a
very bad idea.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
1b4b1461da093bfcb85edfb67710d21f79c7f16c 15-Aug-2012 Richard Trieu <rtrieu@google.com> Check local static variables for self reference on initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
e27a08aa814cb2fe9367163edd612c90aad57789 06-Aug-2012 Richard Trieu <rtrieu@google.com> For global record types, the self reference checker was called twice, resulting
in duplicate -Wuninitialized warnings. Change so that only the check in
TryConstructorInitialization() will be used and a single warning be emitted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
3f635c08b2d0b2d5bafb38da09589cb238407faa 14-Jul-2012 Ted Kremenek <kremenek@apple.com> Refine CFG so that '&&' and '||' don't lead to extra confluence points when used in a branch, but
instead push the terminator for the branch down into the basic blocks of the subexpressions of '&&' and '||'
respectively. This eliminates some artifical control-flow from the CFG and results in a more
compact CFG.

Note that this patch only alters the branches 'while', 'if' and 'for'. This was complex enough for
one patch. The remaining branches (e.g., do...while) can be handled in a separate patch, but they
weren't immediately tackled because they were less important.

It is possible that this patch introduces some subtle bugs, particularly w.r.t. to destructor placement.
I've tried to audit these changes, but it is also known that the destructor logic needs some refinement
in the area of '||' and '&&' regardless (i.e., their are known bugs).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
de5e75caac71d4cfeb9d04cd10281176f43579d6 15-Jun-2012 Richard Trieu <rtrieu@google.com> Use a proper visitor to recursively check for uninitialized use in constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
44f5b1d95a3e4edf12c9b395d9f47767e75037b6 04-Jun-2012 Aaron Ballman <aaron@aaronballman.com> Removing the lambda extension warning concerning single return statements, as it no longer applies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
f6278e545d9bc09fb5d7579d1123f0a455352627 09-May-2012 Richard Trieu <rtrieu@google.com> Pull some cases of initialization with self-reference warnings out of
-Wconditional-uninitialized into -Wuninitialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
7e9f8af453598292cb57ba8e4dd63b9a5814b9ac 09-May-2012 Richard Trieu <rtrieu@google.com> Update the SelfReferenceChecker. Refactored some of the visitor methods.
Added support for conditional operators and tightened the exclusion of the
unary operator from all operators to only the address of operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
c02af35e92909d672b67efee407d2cee6d6d86e5 12-Apr-2012 Ted Kremenek <kremenek@apple.com> Add -Wuninitialized test for C++11 lambdas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
550f2234fc9218914c325041067052342dfce553 22-Mar-2012 Ted Kremenek <kremenek@apple.com> Fix broken CFG when an initializer is a statement expression that starts with a while loop (PR 12325).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
ffea6b4560cee39bd2a26f478e57da19fc3b47b2 08-Mar-2012 Richard Trieu <rtrieu@google.com> Fix -Wuninitialized to catch the case of a class being initialized with a call
to its own member function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
1a5d35539a16f3b2eb2426f3f23a8376b190741c 06-Jan-2012 Rafael Espindola <rafael.espindola@gmail.com> Improvements to the uninitialized variable warning: Check if the constructor
call is elidable or if the constructor is trivial instead of checking if it
is user declared.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
2d9eb21325a0854e86de7344f54a8e6cef2a97ad 15-Nov-2011 Douglas Gregor <dgregor@apple.com> Teach the CFG builder how to properly destroy temporaries who
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>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
47eb89871e020babbaddeed4ee4447bc34824b9f 07-Sep-2011 Richard Trieu <rtrieu@google.com> Change the self-reference visitor (which gives the warning for 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 };


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
898267f67b8131c4bed4430e2cfaf69ccf4c2de1 01-Sep-2011 Richard Trieu <rtrieu@google.com> Extend the self-reference warning to catch when a constructor references itself upon initialization, such as using itself within its own copy constructor.

struct S {};
S s(s);


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
b414c4fae51c5792d3074b4b78fc8737b1d8387c 05-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Fix PR9624 by explicitly disabling uninitialized warnings for direct self-init:

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
d40066b0fb883839a9100e5455e33190b9b8abac 05-Apr-2011 Ted Kremenek <kremenek@apple.com> Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
349894ec70777da4f8fe714670aca43acd2e844e 27-Mar-2011 Chandler Carruth <chandlerc@gmail.com> Add tests for the uninitialized checks added in r128376. Also clean up
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
c75f6180d10e7ac5cd414569b7cbd90cd1295101 30-Oct-2010 Ted Kremenek <kremenek@apple.com> Add test case for <rdar://problem/8610363> (a bogus report of using an uninitialized field). This was
already fixed, but this serves for detecting regressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117754 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp