Skip to content

Commit bc26437

Browse files
committed
address review comments
1 parent 21a385c commit bc26437

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clang/unittests/Analysis/FlowSensitive/TransferTest.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "gtest/gtest.h"
2626
#include <optional>
2727
#include <string>
28+
#include <string_view>
2829
#include <utility>
2930

3031
namespace clang {
@@ -143,7 +144,7 @@ const Formula &getFormula(const ValueDecl &D, const Environment &Env) {
143144
return cast<BoolValue>(Env.getValue(D))->formula();
144145
}
145146

146-
const BindingDecl *findBindingDecl(const char *Name, ASTContext &ASTCtx) {
147+
const BindingDecl *findBindingDecl(ASTContext& ASTCxt, std::string_view Name) {
147148
using ast_matchers::bindingDecl;
148149
using ast_matchers::hasName;
149150
auto TargetNodes =
@@ -5524,10 +5525,10 @@ TEST(TransferTest, StructuredBindingAssignFromTupleLikeType) {
55245525
ASSERT_THAT(Results.keys(), UnorderedElementsAre("p1", "p2"));
55255526
const Environment &Env1 = getEnvironmentAtAnnotation(Results, "p1");
55265527

5527-
const ValueDecl *BoundFooDecl = findBindingDecl("BoundFoo", ASTCtx);
5528+
const ValueDecl *BoundFooDecl = findBindingDecl(ASTCtx, "BoundFoo");
55285529
ASSERT_THAT(BoundFooDecl, NotNull());
55295530

5530-
const ValueDecl *BoundBarDecl = findBindingDecl("BoundBar", ASTCtx);
5531+
const ValueDecl *BoundBarDecl = findBindingDecl(ASTCtx, "BoundBar");
55315532
ASSERT_THAT(BoundBarDecl, NotNull());
55325533

55335534
const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
@@ -5605,10 +5606,10 @@ TEST(TransferTest, StructuredBindingAssignRefFromTupleLikeType) {
56055606
ASSERT_THAT(Results.keys(), UnorderedElementsAre("p1", "p2"));
56065607
const Environment &Env1 = getEnvironmentAtAnnotation(Results, "p1");
56075608

5608-
const ValueDecl *BoundFooDecl = findBindingDecl("BoundFoo", ASTCtx);
5609+
const ValueDecl *BoundFooDecl = findBindingDecl(ASTCtx, "BoundFoo");
56095610
ASSERT_THAT(BoundFooDecl, NotNull());
56105611

5611-
const ValueDecl *BoundBarDecl = findBindingDecl("BoundBar", ASTCtx);
5612+
const ValueDecl *BoundBarDecl = findBindingDecl(ASTCtx, "BoundBar");
56125613
ASSERT_THAT(BoundBarDecl, NotNull());
56135614

56145615
const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");

0 commit comments

Comments
 (0)