summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authormydeveloperday <mydeveloperday@gmail.com>2019-12-20 17:04:49 +0000
committermydeveloperday <mydeveloperday@gmail.com>2019-12-20 17:07:00 +0000
commit2f209ccfbe5e6b33088763b1e022ba876fb0f35c (patch)
tree701774652d86ead6f818aa6a53a2b240e18feb06 /clang/lib/Format/UnwrappedLineParser.cpp
parent190b9110c23c0c742602d686e4a5bcff3d94fba1 (diff)
downloadbcm5719-llvm-2f209ccfbe5e6b33088763b1e022ba876fb0f35c.tar.gz
bcm5719-llvm-2f209ccfbe5e6b33088763b1e022ba876fb0f35c.zip
[clang-format] C# formatting a class with inheritance followed by an attribute specifier assume its a braces initializer
Summary: https://bugs.llvm.org/show_bug.cgi?id=44340 The rule that prevents `... {} [[....]]` being treated as a braced initializer for C++ causes problems for C# with attributes, causing it to be incorrectly classified and then messing up the subsequent formatting. (see bug for details of formatting) Reviewers: mitchell-stellar, klimek, sammccall Reviewed By: mitchell-stellar Subscribers: cfe-commits Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D71769
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 1e27eab1e74..ead6b474320 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -466,7 +466,7 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) {
(NextTok->is(tok::semi) &&
(!ExpectClassBody || LBraceStack.size() != 1)) ||
(NextTok->isBinaryOperator() && !NextIsObjCMethod);
- if (NextTok->is(tok::l_square)) {
+ if (!Style.isCSharp() && NextTok->is(tok::l_square)) {
// We can have an array subscript after a braced init
// list, but C++11 attributes are expected after blocks.
NextTok = Tokens->getNextToken();
OpenPOWER on IntegriCloud