]> granicus.if.org Git - clang/commitdiff
[NFC] Declare instead of define non-void functions in unit tests.
authorShuai Wang <shuaiwang@google.com>
Wed, 19 Sep 2018 20:27:25 +0000 (20:27 +0000)
committerShuai Wang <shuaiwang@google.com>
Wed, 19 Sep 2018 20:27:25 +0000 (20:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342586 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Analysis/ExprMutationAnalyzerTest.cpp

index 8823ac803e341d6892873ab40b527a552994541c..9c6bc783b338af8bb71af6ebe6a9757cf24c348b 100644 (file)
@@ -203,7 +203,7 @@ TEST(ExprMutationAnalyzerTest, ByValueArgument) {
   EXPECT_FALSE(isMutated(Results, AST.get()));
 
   AST = buildASTFromCode(
-      "struct A {}; A operator+(A, int) {} void f() { A x; x + 1; }");
+      "struct A {}; A operator+(A, int); void f() { A x; x + 1; }");
   Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext());
   EXPECT_FALSE(isMutated(Results, AST.get()));
 
@@ -239,7 +239,7 @@ TEST(ExprMutationAnalyzerTest, ByConstValueArgument) {
   EXPECT_FALSE(isMutated(Results, AST.get()));
 
   AST = buildASTFromCode(
-      "struct A {}; A operator+(const A, int) {} void f() { A x; x + 1; }");
+      "struct A {}; A operator+(const A, int); void f() { A x; x + 1; }");
   Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext());
   EXPECT_FALSE(isMutated(Results, AST.get()));
 
@@ -289,7 +289,7 @@ TEST(ExprMutationAnalyzerTest, ByNonConstRefArgument) {
   EXPECT_THAT(mutatedBy(Results, AST.get()), ElementsAre("g(x)"));
 
   AST = buildASTFromCode(
-      "struct A {}; A operator+(A&, int) {} void f() { A x; x + 1; }");
+      "struct A {}; A operator+(A&, int); void f() { A x; x + 1; }");
   Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext());
   EXPECT_THAT(mutatedBy(Results, AST.get()), ElementsAre("x + 1"));
 
@@ -333,7 +333,7 @@ TEST(ExprMutationAnalyzerTest, ByConstRefArgument) {
   EXPECT_FALSE(isMutated(Results, AST.get()));
 
   AST = buildASTFromCode(
-      "struct A {}; A operator+(const A&, int) {} void f() { A x; x + 1; }");
+      "struct A {}; A operator+(const A&, int); void f() { A x; x + 1; }");
   Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext());
   EXPECT_FALSE(isMutated(Results, AST.get()));
 
@@ -356,7 +356,7 @@ TEST(ExprMutationAnalyzerTest, ByNonConstRRefArgument) {
   EXPECT_THAT(mutatedBy(Results, AST.get()),
               ElementsAre("g(static_cast<int &&>(x))"));
 
-  AST = buildASTFromCode("struct A {}; A operator+(A&&, int) {}"
+  AST = buildASTFromCode("struct A {}; A operator+(A&&, int);"
                          "void f() { A x; static_cast<A &&>(x) + 1; }");
   Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext());
   EXPECT_THAT(mutatedBy(Results, AST.get()),
@@ -382,7 +382,7 @@ TEST(ExprMutationAnalyzerTest, ByConstRRefArgument) {
       match(withEnclosingCompound(declRefTo("x")), AST->getASTContext());
   EXPECT_FALSE(isMutated(Results, AST.get()));
 
-  AST = buildASTFromCode("struct A {}; A operator+(const A&&, int) {}"
+  AST = buildASTFromCode("struct A {}; A operator+(const A&&, int);"
                          "void f() { A x; static_cast<A&&>(x) + 1; }");
   Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext());
   EXPECT_FALSE(isMutated(Results, AST.get()));