History log of /external/clang/test/SemaCXX/return-noreturn.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/test/SemaCXX/return-noreturn.cpp
2dd52e3815d040e340a5d953d838cd2268e25372 24-Jan-2012 David Blaikie <dblaikie@gmail.com> Reword/rename -Wswitch-unreachable-default.

Rewording the diagnostic to be more precise/correct: "default label in switch
which covers all enumeration values" and changed the switch to
-Wcovered-switch-default

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
413c2c9d9c85ceb588e9cb965853f178a3a52bc9 23-Jan-2012 David Blaikie <dblaikie@gmail.com> Rename -Wswitch-enum-redundant-default to -Wswitch-redundant-default.

This is for consistency, since the flag is actually under -Wswitch now, rather
than -Wswitch-enum (since it's really valuable for the former and rather
orthogonal to the latter)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
31ceb61172bca7ebc3fb90e9125864c7a29c55c0 21-Jan-2012 David Blaikie <dblaikie@gmail.com> Add -Wswitch-enum-redundant-default.

This warning acts as the complement to the main -Wswitch-enum warning (which
warns whenever a switch over enum without a default doesn't cover all values of
the enum) & has been an an-doc coding convention in LLVM and Clang in my
experience. The purpose is to ensure there's never a "dead" default in a
switch-over-enum because this would hide future -Wswitch-enum errors.

The name warning has a separate flag name so it can be disabled but it's grouped
under -Wswitch-enum & is on-by-default because of this.

The existing violations of this rule in test cases have had the warning disabled
& I've added a specific test for the new behavior (many negative cases already
exist in the same test file - and none regressed - so I didn't add more).

Reviewed by Ted Kremenek ( http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120116/051690.html )

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
762bb9d0ad20320b9f97a841dce57ba5e8e48b07 14-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Update all tests other than Driver/std.cpp to use -std=c++11 rather than
-std=c++0x. Patch by Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
3f224b2efde9b02dcc78c5c85667a62dcd1f5ab3 20-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Fix a pretty nasty bug in noreturn destructors that cascaded into lots
of false positive warnings that depend on noreturn destructors pruning
the CFGs, but only in C++0x mode!

This was really surprising as the debugger quickly reveals that the
attributes are parsed correctly (and using the same code) in both modes.
The warning fires in the same way in both modes. But between parsing and
building the destructor declaration with the noreturn attribute and the
warning, it magically disappears. The key? The 'noexcept' appears!

When we were rebuilding the destructor type with the computed implicit
noexcept we completely dropped the old type on the floor. This almost
makes sense (as the arguments and return type to a destructor aren't
exactly unpredictable), but lost any function type attributes as well.
The fix is simple, we build the new type off of the old one rather than
starting fresh.

Testing this is a bit awkward. I've done it by running the
noreturn-sensitive tests in both modes, which previous failed and now
passes, but if anyone has ideas about how to more specifically and
thoroughly test that the extended info on a destructor is preserved when
adding noexcept, I'm all ears.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
c8cfc74bdcc999828bc232294d937fb191940d5b 13-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Enhance the CFG construction to detect no-return destructors for
temporary objects and local variables. When detected, these split the
block, marking the new one as having only the exit block as a successor.
This prevents a large number of false positives in warnings sensitive to
no-return constructs such as -Wreturn-type, and fixes the remainder of
PR10063 along with several variations of this bug that had not been
reported. The test cases are extended across the board to cover these
patterns.

This also checks in a stress test for these types of CFGs. The stress
test declares some 32k variables, a mixture of no-return and normal
destructors. Previously, this resulted in roughly 2500 CFG blocks, but
didn't model any of the no-return destructors. With this patch, it
results in over 33k blocks, many of them now unreachable.

The nice thing about how the analyzer is set up? This causes *no*
regression in performance of building the CFG. It actually in some cases
makes it faster, as best I can benchmark. The analysis for -Wreturn-type
(and any other that cares about no-return code paths) is technically
slower now as it has to look at many more candidate blocks, but it
computes the correct answer. I have more test cases to follow, I think
they all work now. Also I have further work that should dramatically
simplify analyses in the presence of no-return.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
a1364be341550d71dff27dd8de0c6872ba6c707e 10-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Extend the Stmt AST to make it easier to look through label, default,
and case statements. Use this to make the logic in the CFG builder more
robust at finding the actual statements within a compound statement,
even when there are many layers of labels obscuring it.

Also extend the test cases for a large chunk of PR10063. Still more work
to do here though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
6e40035988965340555c942d6e7afb6c7527beb1 07-Mar-2011 Ted Kremenek <kremenek@apple.com> Fix null dereference in CFGBlock::FilterEdge that was reported in PR 9412.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
9ca957aaa2c2e5ee07f5e98d6eca8f426dcb4a8e 03-Mar-2011 Ted Kremenek <kremenek@apple.com> Add coverage test for CFGImplicitDtor::getDestructorDecl() when handling typedefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
c5aff4497e5bfd7523e00b87560c1a5aa65136cc 03-Mar-2011 Ted Kremenek <kremenek@apple.com> Teach CFGImplicitDtor::getDestructorDecl() about arrays of objects with destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
697d42db6cba7a5994d955ce31be2c097902cf0c 03-Mar-2011 Ted Kremenek <kremenek@apple.com> Teach CFGImplicitDtor::getDestructorDecl() about reference types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
c9f8f5a726bbb562e4b2d4b19d66e6202dcb2657 02-Mar-2011 Ted Kremenek <kremenek@apple.com> Introduce CFGImplicitDtor::isNoReturn() to query whether a destructor actually returns. Use this for -Wreturn-type to prune false positives reported in PR 6884.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
8b3b3db2f6eef4080c9c99c3c3af582f9e8fa41e 25-Jan-2011 Ted Kremenek <kremenek@apple.com> Tweak return-noreturn.cpp test to have its original
contents, with the additional warning flag (and still marked XFAIL).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
f39e6a388aaa2f155b46c61e655784b2473218eb 25-Jan-2011 Ted Kremenek <kremenek@apple.com> Fix regression in -Wreturn-type caused by not
handling all CFGElement kinds. While writing
the test case, it turned out that return-noreturn.cpp
wasn't actually testing anything since it has the wrong -W
flag. That uncovered another regression with
the handling of destructors marked noreturn. WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
eeef924c4fcb79a3bcc8782afce343e641bbcb83 08-Jan-2011 Chandler Carruth <chandlerc@gmail.com> Remove a kludge from analysis based warnings that used to detect
temporaries with no-return destructors. The CFG now properly supports
temporaries and implicit destructors which both makes this kludge no
longer work, and conveniently removes the need for it.

Turn on CFG handling of implicit destructors and initializers. Several
ad-hoc benchmarks don't indicate any measurable performance impact from
growing the CFG, and it fixes real correctness problems with warnings.

As a result of turning on these CFG elements, we started to tickle an
inf-loop in the unreachable code logic used for warnings. The fix is
trivial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
2c1b9c3fa3d920aa6ccf843b40c1eb0f1ad04d58 28-Aug-2010 Ted Kremenek <kremenek@apple.com> Update test case, with comment to later investigate the correct behavior. Now the behavior is at least consistent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/return-noreturn.cpp
00e9cbb13d3e5deb8ee27288e0ed816266ec9e5b 18-May-2010 Chandler Carruth <chandlerc@gmail.com> Add a hack to silence warnings about failing to return from functions after
a temporary with a noreturn destructor has been created. Fixes PR6884 for now.


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