aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendAction.cpp
diff options
context:
space:
mode:
authorGalen Elias <galenelias@gmail.com>2023-05-22 20:11:17 -0700
committerOwen Pan <owenpiano@gmail.com>2023-05-22 20:25:55 -0700
commit6dcde658b2380d7ca1451ea5d1099af3e294ea16 (patch)
treede2ac21f56b1c2b2ac4b362547aa22715eb6d29f /clang/lib/Frontend/FrontendAction.cpp
parent4fafa39b76b8e11960a75d7b15d762840330ecbf (diff)
downloadllvm-6dcde658b2380d7ca1451ea5d1099af3e294ea16.zip
llvm-6dcde658b2380d7ca1451ea5d1099af3e294ea16.tar.gz
llvm-6dcde658b2380d7ca1451ea5d1099af3e294ea16.tar.bz2
This is a retry of https://reviews.llvm.org/D114583, which was backed
out for regressions. Clang Format is detecting a nested scope followed by another open brace as a braced initializer list due to incorrectly thinking it's matching a braced initializer at the end of a constructor initializer list which is followed by the body open brace. Unfortunately, UnwrappedLineParser isn't doing a very detailed parse, so it's not super straightforward to distinguish these cases given the current structure of calculateBraceTypes. My current hypothesis is that these can be disambiguated by looking at the token preceding the l_brace, as initializer list parameters will be preceded by an identifier, but a scope block generally will not (barring the MACRO wildcard). To this end, I am adding tracking of the previous token to the LBraceStack to help scope this particular case. TokenAnnotatorTests cherry picked from https://reviews.llvm.org/D150452. Fixes #33891. Fixes #52911. Differential Revision: https://reviews.llvm.org/D150403
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
0 files changed, 0 insertions, 0 deletions