]> granicus.if.org Git - clang/commit
Warn when jumping out of a __finally block via goto.
authorNico Weber <nicolasweber@gmx.de>
Mon, 9 Mar 2015 04:27:56 +0000 (04:27 +0000)
committerNico Weber <nicolasweber@gmx.de>
Mon, 9 Mar 2015 04:27:56 +0000 (04:27 +0000)
commit8880714d42677267f7aee51a630476fcfb822e1a
tree141cd6aa296eee86311a5401a1321037cc0fae1c
parent0bf9e4ff0b534b8a9e310dd5debb33da82da22fb
Warn when jumping out of a __finally block via goto.

This only warns on direct gotos and indirect gotos with a unique label
(`goto *&&label;`).  Jumping out ith a true indirect goto is already an error.

This isn't O(1), but goto statements are less common than continue, break, and
return.  Also, the GetDeepestCommonScope() call in the same function does the
same amount of work, so this isn't worse than what's there in a complexity
sense, and it should be pretty fast in practice.

This is the last piece that was missing in r231623.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231628 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/JumpDiagnostics.cpp
test/SemaCXX/scope-check.cpp