From 669080226314b6989cb71722f1950665f88b303b Mon Sep 17 00:00:00 2001 From: Shuai Wang Date: Wed, 19 Sep 2018 20:27:25 +0000 Subject: [PATCH] [NFC] Declare instead of define non-void functions in unit tests. llvm-svn: 342586 --- clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp b/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp index 8823ac8..9c6bc78 100644 --- a/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp +++ b/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp @@ -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(x))")); - AST = buildASTFromCode("struct A {}; A operator+(A&&, int) {}" + AST = buildASTFromCode("struct A {}; A operator+(A&&, int);" "void f() { A x; static_cast(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(x) + 1; }"); Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext()); EXPECT_FALSE(isMutated(Results, AST.get())); -- 2.7.4