History log of /external/clang/test/SemaCXX/uninitialized.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b6d6993e6e6d3daf4d9876794254d20a134e37c2 01-Jul-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r239765

Change-Id: I0393bcc952590a7226af8c4b58534a8ee5fd2d99
/external/clang/test/SemaCXX/uninitialized.cpp
3ea9e33ea25e0c2b12db56418ba3f994eb662c04 08-Apr-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r233350

Change-Id: I12d4823f10bc9e445b8b86e7721b71f98d1df442
/external/clang/test/SemaCXX/uninitialized.cpp
0e2c34f92f00628d48968dfea096d36381f494cb 23-Mar-2015 Stephen Hines <srhines@google.com> Update aosp/master clang for rebase to r230699.

Change-Id: I6a546ab3d4ae37119eebb735e102cca4f80ab520
/external/clang/test/SemaCXX/uninitialized.cpp
176edba5311f6eff0cad2631449885ddf4fbc9ea 01-Dec-2014 Stephen Hines <srhines@google.com> Update aosp/master Clang for rebase to r222490.

Change-Id: Ic557ac55e97fbf6ee08771c7b7c3594777b0aefd
/external/clang/test/SemaCXX/uninitialized.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/test/SemaCXX/uninitialized.cpp
858d2ba136c8dcdc051fe20b3190c40bc25de189 25-Oct-2013 Richard Trieu <rtrieu@google.com> Simplify and refactor the uninitialized field warning.

Change the uninitialized field warnings so that field initializers are checked
inside the constructor. Previously, in class initializers were checked
separately. Running one set of checks also simplifies the logic for preventing
duplicate warnings. Added new checks to warn when an uninitialized field is
used in base class initialization. Also fixed misspelling of uninitialized
and moved all code for this warning together.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
ef8f90caa14d85cffba2fea4b6bd425c3b22eea7 20-Sep-2013 Richard Trieu <rtrieu@google.com> Modify the uninitialized field visitor to detect uninitialized use across the
fields in the class. This allows a better checking of member intiailizers and
in class initializers in regards to initialization ordering.

For instance, this code will now produce warnings:

class A {
int x;
int y;
A() : x(y) {} // y is initialized after x, warn here
A(int): y(x) {} // default initialization of leaves x uninitialized, warn here
};

Several test cases were updated with -Wno-uninitialized to silence this warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
fbb08b5ec01fbdeb6219fbba0f5edfd95c752233 13-Sep-2013 Richard Trieu <rtrieu@google.com> Refactor the uninitialized field visitor. Also moved the calls to the visitor
later in the code so that the expressions will have addition processing first.
This catches a few additional cases of uninitialized uses of class fields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
0f2fc5ff49cb9abd6c6972ffd6db066295672867 03-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15906: The body of a lambda is not an evaluated subexpression; don't visit it when visiting such subexpressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181046 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
8af742a499bf13f0a3d53b03aa44ae748fadd61e 26-Mar-2013 Richard Trieu <rtrieu@google.com> Handle CXXOperatorCallExpr when checking self referrnce during initialization of
class types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
39371b8bbf1bb54bcadef74cffefc98ca8f00b76 19-Jan-2013 Ted Kremenek <kremenek@apple.com> Reapply r172878 with test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
77fd3c0d7837040bb84c1617a6a423f833e784fe 19-Jan-2013 Ted Kremenek <kremenek@apple.com> -Wuninitialized: warn about uninitialized values resulting from ?: that evaluate to lvalues (in C++).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
6b2cc42f1504db6577fd67fa55ef023254744e2c 03-Oct-2012 Richard Trieu <rtrieu@google.com> Change how the SelfReferenceChecker handles MemberExpr. Instead of treating
each one separately, process a stack of MemberExpr's as a single unit so that
static calls and member access will not be warned on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
568f785a76e0a21de20932abf09ce7653e651f92 01-Oct-2012 Richard Trieu <rtrieu@google.com> Cleaning up the self initialization checker.
-Allow Sema to do more processing on the initial Expr before checking it.
-Remove the special conditions in HandleExpr()
-Move the code so that only one call site is needed.
-Removed the function from Sema and only call it locally.
-Warn on potentially evaluated reference variables, not just casts to r-values.
-Update tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
7821e0756744018a34c533f30cdabe62a72d4e4a 21-Sep-2012 Hans Wennborg <hans@hanshq.net> Make warnings about uninitialized fields include the field name.

This makes the wording more informative, and consistent with the other
warnings about uninitialized variables.

Also, me and David who reviewed this couldn't figure out why we would
need to do a lookup to get the name of the variable; so just print the
name directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
471f985ae04817e0e8198a925fc7d74eaacaf962 18-Sep-2012 Hans Wennborg <hans@hanshq.net> Warn about self references in in-class initializers.

This makes Clang warn about self references in in-class initializers,
for example:

struct S {
int a = a + 42;
};

This basically just moves UninitializedFieldVisitor up a bit in
SemaDeclCXX.cpp, and adds a call to it from ActOnCXXInClassMemberInitializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/uninitialized.cpp
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