llvm-project/clang/unittests
Martin Probst 95ed8e7928 clang-format: [JS] improve calculateBraceType heuristic
Summary:

calculateBraceTypes decides for braced init for empty brace pairs ({}).
In context of a function declaration, this incorrectly classifies empty
function or method bodies as braced inits, leading to missing wraps:

    class C {
      foo() {}[bar]() {}
    }

Where code should have wrapped after "}", before "[". This change adds
another piece of contextual information in that braces following closing
parentheses must always be the opening braces of function blocks. This
fixes brace detection for methods immediately followed by brackets
(computed property declarations), but also curlies.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D33714

llvm-svn: 304290
2017-05-31 09:29:40 +00:00
..
AST Tracking exception specification source locations 2017-01-12 16:11:28 +00:00
ASTMatchers Add cxxStdInitializerListExpr AST matcher 2017-05-05 21:01:12 +00:00
Analysis [analyzer] Reland r299544 "Add a modular constraint system to the CloneDetector" 2017-04-06 14:34:07 +00:00
Basic [modules] Round-trip -Werror flag through explicit module build. 2017-05-03 00:28:49 +00:00
CodeGen Make sure the LLVMContext outlive the CompilerInstance 2016-04-14 05:37:41 +00:00
Driver Driver must return non-zero code on errors in command line 2017-05-24 14:57:17 +00:00
Format clang-format: [JS] improve calculateBraceType heuristic 2017-05-31 09:29:40 +00:00
Frontend Refactor frontend InputKind to prepare for treating module maps as a distinct kind of input. 2017-04-26 18:57:40 +00:00
Lex Reapply "Modules: Cache PCMs in memory and avoid a use-after-free" 2017-03-20 17:58:26 +00:00
Rewrite Remove autoconf support 2016-01-26 21:30:40 +00:00
Sema [Sema] Allow an external sema source to handle delayed typo corrections. 2016-05-19 10:46:10 +00:00
StaticAnalyzer Add a method to get the list of registered static analyzer checkers. 2016-11-08 07:23:32 +00:00
Tooling Method loadFromCommandLine should be able to report errors 2017-05-24 11:57:37 +00:00
libclang Fixed more signed/unsigned mismatch warnings introduced in my change at r279076 2016-08-18 20:56:48 +00:00
CMakeLists.txt CFGBuilder: Fix crash when visiting a range-based for over a dependent type 2016-07-08 10:50:51 +00:00