[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-04-04 Thread via cfe-commits

llvmbot wrote:

/pull-request llvm/llvm-project#87735

https://github.com/llvm/llvm-project/pull/82097
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-04-04 Thread Owen Pan via cfe-commits

owenca wrote:

/cherry-pick 8de230093f58

https://github.com/llvm/llvm-project/pull/82097
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-04-01 Thread Owen Pan via cfe-commits

https://github.com/owenca milestoned 
https://github.com/llvm/llvm-project/pull/82097
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-02-19 Thread Owen Pan via cfe-commits

https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/82097
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-02-19 Thread via cfe-commits

https://github.com/mydeveloperday approved this pull request.


https://github.com/llvm/llvm-project/pull/82097
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-02-16 Thread Owen Pan via cfe-commits

https://github.com/owenca updated 
https://github.com/llvm/llvm-project/pull/82097

>From f02c1acefe642065cae01ced98b168ce33b98d47 Mon Sep 17 00:00:00 2001
From: Owen Pan 
Date: Fri, 16 Feb 2024 23:27:12 -0800
Subject: [PATCH 1/2] [clang-format] Correctly annotate block braces of empty
 ctors/dtors

Also reformat polly.

Fixes #79834.
---
 clang/lib/Format/TokenAnnotator.cpp   | 20 +--
 clang/unittests/Format/TokenAnnotatorTest.cpp | 14 +
 polly/lib/Exchange/JSONExporter.cpp   |  2 +-
 polly/lib/Transform/DeLICM.cpp|  2 +-
 polly/lib/Transform/FlattenSchedule.cpp   |  2 +-
 polly/lib/Transform/ForwardOpTree.cpp |  2 +-
 6 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/clang/lib/Format/TokenAnnotator.cpp 
b/clang/lib/Format/TokenAnnotator.cpp
index ac876bf4442e95..932b520bd68ece 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -3754,10 +3754,11 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
   for (AnnotatedLine *ChildLine : Line.Children)
 calculateFormattingInformation(*ChildLine);
 
-  Line.First->TotalLength =
-  Line.First->IsMultiline ? Style.ColumnLimit
-  : Line.FirstStartColumn + 
Line.First->ColumnWidth;
-  FormatToken *Current = Line.First->Next;
+  auto *First = Line.First;
+  First->TotalLength = First->IsMultiline
+   ? Style.ColumnLimit
+   : Line.FirstStartColumn + First->ColumnWidth;
+  FormatToken *Current = First->Next;
   bool InFunctionDecl = Line.MightBeFunctionDecl;
   bool AlignArrayOfStructures =
   (Style.AlignArrayOfStructures != FormatStyle::AIAS_None &&
@@ -3779,16 +3780,15 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
 if (const bool IsCtorOrDtor = Tok->is(TT_CtorDtorDeclName);
 IsCtorOrDtor ||
 isFunctionDeclarationName(Style.isCpp(), *Tok, Line, ClosingParen)) {
-  if (!IsCtorOrDtor) {
-LineIsFunctionDeclaration = true;
+  if (!IsCtorOrDtor)
 Tok->setFinalizedType(TT_FunctionDeclarationName);
-  }
+  LineIsFunctionDeclaration = true;
   SeenName = true;
   break;
 }
   }
 
-  if (IsCpp && LineIsFunctionDeclaration &&
+  if (IsCpp && (LineIsFunctionDeclaration || First->is(TT_CtorDtorDeclName)) &&
   Line.endsWith(tok::semi, tok::r_brace)) {
 auto *Tok = Line.Last->Previous;
 while (Tok->isNot(tok::r_brace))
@@ -3811,7 +3811,7 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
   if (IsCpp) {
 if (!LineIsFunctionDeclaration) {
   // Annotate */&/&& in `operator` function calls as binary operators.
-  for (const auto *Tok = Line.First; Tok; Tok = Tok->Next) {
+  for (const auto *Tok = First; Tok; Tok = Tok->Next) {
 if (Tok->isNot(tok::kw_operator))
   continue;
 do {
@@ -3948,7 +3948,7 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
 
   calculateUnbreakableTailLengths(Line);
   unsigned IndentLevel = Line.Level;
-  for (Current = Line.First; Current; Current = Current->Next) {
+  for (Current = First; Current; Current = Current->Next) {
 if (Current->Role)
   Current->Role->precomputeFormattingInfos(Current);
 if (Current->MatchingParen &&
diff --git a/clang/unittests/Format/TokenAnnotatorTest.cpp 
b/clang/unittests/Format/TokenAnnotatorTest.cpp
index 3b36e407228195..c736dac8dabf21 100644
--- a/clang/unittests/Format/TokenAnnotatorTest.cpp
+++ b/clang/unittests/Format/TokenAnnotatorTest.cpp
@@ -2678,6 +2678,20 @@ TEST_F(TokenAnnotatorTest, BraceKind) {
   EXPECT_TOKEN(Tokens[4], tok::l_brace, TT_FunctionLBrace);
   EXPECT_BRACE_KIND(Tokens[4], BK_Block);
   EXPECT_BRACE_KIND(Tokens[6], BK_Block);
+
+  Tokens = annotate("struct Foo {\n"
+"  Foo() {};\n"
+"  ~Foo() {};\n"
+"};");
+  ASSERT_EQ(Tokens.size(), 19u) << Tokens;
+  EXPECT_TOKEN(Tokens[3], tok::identifier, TT_CtorDtorDeclName);
+  EXPECT_TOKEN(Tokens[6], tok::l_brace, TT_FunctionLBrace);
+  EXPECT_BRACE_KIND(Tokens[6], BK_Block);
+  EXPECT_BRACE_KIND(Tokens[7], BK_Block);
+  EXPECT_TOKEN(Tokens[10], tok::identifier, TT_CtorDtorDeclName);
+  EXPECT_TOKEN(Tokens[13], tok::l_brace, TT_FunctionLBrace);
+  EXPECT_BRACE_KIND(Tokens[13], BK_Block);
+  EXPECT_BRACE_KIND(Tokens[14], BK_Block);
 }
 
 TEST_F(TokenAnnotatorTest, StreamOperator) {
diff --git a/polly/lib/Exchange/JSONExporter.cpp 
b/polly/lib/Exchange/JSONExporter.cpp
index 74d4e6c7993fa3..845e4c78ab5475 100644
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -842,7 +842,7 @@ class JSONImporterPrinterLegacyPass final : public ScopPass 
{
 public:
   static char ID;
 
-  JSONImporterPrinterLegacyPass() : JSONImporterPrinterLegacyPass(outs()){};
+  JSONImporterPrinterLegacyPass() : 

[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-02-16 Thread via cfe-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff 6087d7bc0a9d7d4ad2c94a131c2bc427b767c9d7 
f02c1acefe642065cae01ced98b168ce33b98d47 -- clang/lib/Format/TokenAnnotator.cpp 
clang/unittests/Format/TokenAnnotatorTest.cpp 
polly/lib/Exchange/JSONExporter.cpp polly/lib/Transform/DeLICM.cpp 
polly/lib/Transform/FlattenSchedule.cpp polly/lib/Transform/ForwardOpTree.cpp
``





View the diff from clang-format here.


``diff
diff --git a/polly/lib/Exchange/JSONExporter.cpp 
b/polly/lib/Exchange/JSONExporter.cpp
index 845e4c78ab..74d4e6c799 100644
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -842,7 +842,7 @@ class JSONImporterPrinterLegacyPass final : public ScopPass 
{
 public:
   static char ID;
 
-  JSONImporterPrinterLegacyPass() : JSONImporterPrinterLegacyPass(outs()) {};
+  JSONImporterPrinterLegacyPass() : JSONImporterPrinterLegacyPass(outs()){};
   explicit JSONImporterPrinterLegacyPass(llvm::raw_ostream )
   : ScopPass(ID), OS(OS) {}
 
diff --git a/polly/lib/Transform/DeLICM.cpp b/polly/lib/Transform/DeLICM.cpp
index 58964dd45e..51e7013465 100644
--- a/polly/lib/Transform/DeLICM.cpp
+++ b/polly/lib/Transform/DeLICM.cpp
@@ -1463,7 +1463,7 @@ class DeLICMPrinterLegacyPass final : public ScopPass {
 public:
   static char ID;
 
-  DeLICMPrinterLegacyPass() : DeLICMPrinterLegacyPass(outs()) {};
+  DeLICMPrinterLegacyPass() : DeLICMPrinterLegacyPass(outs()){};
   explicit DeLICMPrinterLegacyPass(llvm::raw_ostream )
   : ScopPass(ID), OS(OS) {}
 
diff --git a/polly/lib/Transform/FlattenSchedule.cpp 
b/polly/lib/Transform/FlattenSchedule.cpp
index 34c51dd28e..53e230be7a 100644
--- a/polly/lib/Transform/FlattenSchedule.cpp
+++ b/polly/lib/Transform/FlattenSchedule.cpp
@@ -103,7 +103,7 @@ public:
   static char ID;
 
   FlattenSchedulePrinterLegacyPass()
-  : FlattenSchedulePrinterLegacyPass(outs()) {};
+  : FlattenSchedulePrinterLegacyPass(outs()){};
   explicit FlattenSchedulePrinterLegacyPass(llvm::raw_ostream )
   : ScopPass(ID), OS(OS) {}
 
diff --git a/polly/lib/Transform/ForwardOpTree.cpp 
b/polly/lib/Transform/ForwardOpTree.cpp
index 0b9582d065..2bed3e3541 100644
--- a/polly/lib/Transform/ForwardOpTree.cpp
+++ b/polly/lib/Transform/ForwardOpTree.cpp
@@ -1149,7 +1149,7 @@ class ForwardOpTreePrinterLegacyPass final : public 
ScopPass {
 public:
   static char ID;
 
-  ForwardOpTreePrinterLegacyPass() : ForwardOpTreePrinterLegacyPass(outs()) {};
+  ForwardOpTreePrinterLegacyPass() : ForwardOpTreePrinterLegacyPass(outs()){};
   explicit ForwardOpTreePrinterLegacyPass(llvm::raw_ostream )
   : ScopPass(ID), OS(OS) {}
 

``




https://github.com/llvm/llvm-project/pull/82097
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-02-16 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-format

Author: Owen Pan (owenca)


Changes

Also reformat polly.

Fixes #79834.

---
Full diff: https://github.com/llvm/llvm-project/pull/82097.diff


6 Files Affected:

- (modified) clang/lib/Format/TokenAnnotator.cpp (+10-10) 
- (modified) clang/unittests/Format/TokenAnnotatorTest.cpp (+14) 
- (modified) polly/lib/Exchange/JSONExporter.cpp (+1-1) 
- (modified) polly/lib/Transform/DeLICM.cpp (+1-1) 
- (modified) polly/lib/Transform/FlattenSchedule.cpp (+1-1) 
- (modified) polly/lib/Transform/ForwardOpTree.cpp (+1-1) 


``diff
diff --git a/clang/lib/Format/TokenAnnotator.cpp 
b/clang/lib/Format/TokenAnnotator.cpp
index ac876bf4442e95..932b520bd68ece 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -3754,10 +3754,11 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
   for (AnnotatedLine *ChildLine : Line.Children)
 calculateFormattingInformation(*ChildLine);
 
-  Line.First->TotalLength =
-  Line.First->IsMultiline ? Style.ColumnLimit
-  : Line.FirstStartColumn + 
Line.First->ColumnWidth;
-  FormatToken *Current = Line.First->Next;
+  auto *First = Line.First;
+  First->TotalLength = First->IsMultiline
+   ? Style.ColumnLimit
+   : Line.FirstStartColumn + First->ColumnWidth;
+  FormatToken *Current = First->Next;
   bool InFunctionDecl = Line.MightBeFunctionDecl;
   bool AlignArrayOfStructures =
   (Style.AlignArrayOfStructures != FormatStyle::AIAS_None &&
@@ -3779,16 +3780,15 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
 if (const bool IsCtorOrDtor = Tok->is(TT_CtorDtorDeclName);
 IsCtorOrDtor ||
 isFunctionDeclarationName(Style.isCpp(), *Tok, Line, ClosingParen)) {
-  if (!IsCtorOrDtor) {
-LineIsFunctionDeclaration = true;
+  if (!IsCtorOrDtor)
 Tok->setFinalizedType(TT_FunctionDeclarationName);
-  }
+  LineIsFunctionDeclaration = true;
   SeenName = true;
   break;
 }
   }
 
-  if (IsCpp && LineIsFunctionDeclaration &&
+  if (IsCpp && (LineIsFunctionDeclaration || First->is(TT_CtorDtorDeclName)) &&
   Line.endsWith(tok::semi, tok::r_brace)) {
 auto *Tok = Line.Last->Previous;
 while (Tok->isNot(tok::r_brace))
@@ -3811,7 +3811,7 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
   if (IsCpp) {
 if (!LineIsFunctionDeclaration) {
   // Annotate */&/&& in `operator` function calls as binary operators.
-  for (const auto *Tok = Line.First; Tok; Tok = Tok->Next) {
+  for (const auto *Tok = First; Tok; Tok = Tok->Next) {
 if (Tok->isNot(tok::kw_operator))
   continue;
 do {
@@ -3948,7 +3948,7 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
 
   calculateUnbreakableTailLengths(Line);
   unsigned IndentLevel = Line.Level;
-  for (Current = Line.First; Current; Current = Current->Next) {
+  for (Current = First; Current; Current = Current->Next) {
 if (Current->Role)
   Current->Role->precomputeFormattingInfos(Current);
 if (Current->MatchingParen &&
diff --git a/clang/unittests/Format/TokenAnnotatorTest.cpp 
b/clang/unittests/Format/TokenAnnotatorTest.cpp
index 3b36e407228195..c736dac8dabf21 100644
--- a/clang/unittests/Format/TokenAnnotatorTest.cpp
+++ b/clang/unittests/Format/TokenAnnotatorTest.cpp
@@ -2678,6 +2678,20 @@ TEST_F(TokenAnnotatorTest, BraceKind) {
   EXPECT_TOKEN(Tokens[4], tok::l_brace, TT_FunctionLBrace);
   EXPECT_BRACE_KIND(Tokens[4], BK_Block);
   EXPECT_BRACE_KIND(Tokens[6], BK_Block);
+
+  Tokens = annotate("struct Foo {\n"
+"  Foo() {};\n"
+"  ~Foo() {};\n"
+"};");
+  ASSERT_EQ(Tokens.size(), 19u) << Tokens;
+  EXPECT_TOKEN(Tokens[3], tok::identifier, TT_CtorDtorDeclName);
+  EXPECT_TOKEN(Tokens[6], tok::l_brace, TT_FunctionLBrace);
+  EXPECT_BRACE_KIND(Tokens[6], BK_Block);
+  EXPECT_BRACE_KIND(Tokens[7], BK_Block);
+  EXPECT_TOKEN(Tokens[10], tok::identifier, TT_CtorDtorDeclName);
+  EXPECT_TOKEN(Tokens[13], tok::l_brace, TT_FunctionLBrace);
+  EXPECT_BRACE_KIND(Tokens[13], BK_Block);
+  EXPECT_BRACE_KIND(Tokens[14], BK_Block);
 }
 
 TEST_F(TokenAnnotatorTest, StreamOperator) {
diff --git a/polly/lib/Exchange/JSONExporter.cpp 
b/polly/lib/Exchange/JSONExporter.cpp
index 74d4e6c7993fa3..845e4c78ab5475 100644
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -842,7 +842,7 @@ class JSONImporterPrinterLegacyPass final : public ScopPass 
{
 public:
   static char ID;
 
-  JSONImporterPrinterLegacyPass() : JSONImporterPrinterLegacyPass(outs()){};
+  JSONImporterPrinterLegacyPass() : JSONImporterPrinterLegacyPass(outs()) {};
   explicit JSONImporterPrinterLegacyPass(llvm::raw_ostream )
   : ScopPass(ID), OS(OS) {}
 
diff --git a/polly/lib/Transform/DeLICM.cpp 

[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-02-16 Thread Owen Pan via cfe-commits

https://github.com/owenca created 
https://github.com/llvm/llvm-project/pull/82097

Also reformat polly.

Fixes #79834.

>From f02c1acefe642065cae01ced98b168ce33b98d47 Mon Sep 17 00:00:00 2001
From: Owen Pan 
Date: Fri, 16 Feb 2024 23:27:12 -0800
Subject: [PATCH] [clang-format] Correctly annotate block braces of empty
 ctors/dtors

Also reformat polly.

Fixes #79834.
---
 clang/lib/Format/TokenAnnotator.cpp   | 20 +--
 clang/unittests/Format/TokenAnnotatorTest.cpp | 14 +
 polly/lib/Exchange/JSONExporter.cpp   |  2 +-
 polly/lib/Transform/DeLICM.cpp|  2 +-
 polly/lib/Transform/FlattenSchedule.cpp   |  2 +-
 polly/lib/Transform/ForwardOpTree.cpp |  2 +-
 6 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/clang/lib/Format/TokenAnnotator.cpp 
b/clang/lib/Format/TokenAnnotator.cpp
index ac876bf4442e95..932b520bd68ece 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -3754,10 +3754,11 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
   for (AnnotatedLine *ChildLine : Line.Children)
 calculateFormattingInformation(*ChildLine);
 
-  Line.First->TotalLength =
-  Line.First->IsMultiline ? Style.ColumnLimit
-  : Line.FirstStartColumn + 
Line.First->ColumnWidth;
-  FormatToken *Current = Line.First->Next;
+  auto *First = Line.First;
+  First->TotalLength = First->IsMultiline
+   ? Style.ColumnLimit
+   : Line.FirstStartColumn + First->ColumnWidth;
+  FormatToken *Current = First->Next;
   bool InFunctionDecl = Line.MightBeFunctionDecl;
   bool AlignArrayOfStructures =
   (Style.AlignArrayOfStructures != FormatStyle::AIAS_None &&
@@ -3779,16 +3780,15 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
 if (const bool IsCtorOrDtor = Tok->is(TT_CtorDtorDeclName);
 IsCtorOrDtor ||
 isFunctionDeclarationName(Style.isCpp(), *Tok, Line, ClosingParen)) {
-  if (!IsCtorOrDtor) {
-LineIsFunctionDeclaration = true;
+  if (!IsCtorOrDtor)
 Tok->setFinalizedType(TT_FunctionDeclarationName);
-  }
+  LineIsFunctionDeclaration = true;
   SeenName = true;
   break;
 }
   }
 
-  if (IsCpp && LineIsFunctionDeclaration &&
+  if (IsCpp && (LineIsFunctionDeclaration || First->is(TT_CtorDtorDeclName)) &&
   Line.endsWith(tok::semi, tok::r_brace)) {
 auto *Tok = Line.Last->Previous;
 while (Tok->isNot(tok::r_brace))
@@ -3811,7 +3811,7 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
   if (IsCpp) {
 if (!LineIsFunctionDeclaration) {
   // Annotate */&/&& in `operator` function calls as binary operators.
-  for (const auto *Tok = Line.First; Tok; Tok = Tok->Next) {
+  for (const auto *Tok = First; Tok; Tok = Tok->Next) {
 if (Tok->isNot(tok::kw_operator))
   continue;
 do {
@@ -3948,7 +3948,7 @@ void 
TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const {
 
   calculateUnbreakableTailLengths(Line);
   unsigned IndentLevel = Line.Level;
-  for (Current = Line.First; Current; Current = Current->Next) {
+  for (Current = First; Current; Current = Current->Next) {
 if (Current->Role)
   Current->Role->precomputeFormattingInfos(Current);
 if (Current->MatchingParen &&
diff --git a/clang/unittests/Format/TokenAnnotatorTest.cpp 
b/clang/unittests/Format/TokenAnnotatorTest.cpp
index 3b36e407228195..c736dac8dabf21 100644
--- a/clang/unittests/Format/TokenAnnotatorTest.cpp
+++ b/clang/unittests/Format/TokenAnnotatorTest.cpp
@@ -2678,6 +2678,20 @@ TEST_F(TokenAnnotatorTest, BraceKind) {
   EXPECT_TOKEN(Tokens[4], tok::l_brace, TT_FunctionLBrace);
   EXPECT_BRACE_KIND(Tokens[4], BK_Block);
   EXPECT_BRACE_KIND(Tokens[6], BK_Block);
+
+  Tokens = annotate("struct Foo {\n"
+"  Foo() {};\n"
+"  ~Foo() {};\n"
+"};");
+  ASSERT_EQ(Tokens.size(), 19u) << Tokens;
+  EXPECT_TOKEN(Tokens[3], tok::identifier, TT_CtorDtorDeclName);
+  EXPECT_TOKEN(Tokens[6], tok::l_brace, TT_FunctionLBrace);
+  EXPECT_BRACE_KIND(Tokens[6], BK_Block);
+  EXPECT_BRACE_KIND(Tokens[7], BK_Block);
+  EXPECT_TOKEN(Tokens[10], tok::identifier, TT_CtorDtorDeclName);
+  EXPECT_TOKEN(Tokens[13], tok::l_brace, TT_FunctionLBrace);
+  EXPECT_BRACE_KIND(Tokens[13], BK_Block);
+  EXPECT_BRACE_KIND(Tokens[14], BK_Block);
 }
 
 TEST_F(TokenAnnotatorTest, StreamOperator) {
diff --git a/polly/lib/Exchange/JSONExporter.cpp 
b/polly/lib/Exchange/JSONExporter.cpp
index 74d4e6c7993fa3..845e4c78ab5475 100644
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -842,7 +842,7 @@ class JSONImporterPrinterLegacyPass final : public ScopPass 
{
 public:
   static char ID;
 
-  JSONImporterPrinterLegacyPass() : JSONImporterPrinterLegacyPass(outs()){};
+