Skip to content

Commit e653a69

Browse files
committed
Address code review comments
1 parent 4cd4888 commit e653a69

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

clang/docs/LibASTMatchersReference.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3450,9 +3450,9 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
34503450

34513451

34523452
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1DependentScopeDeclRefExpr.html">DependentScopeDeclRefExpr</a>&gt;</td><td class="name" onclick="toggle('hasDependentName0')"><a name="hasDependentName0Anchor">hasDependentName</a></td><td>std::string N</td></tr>
3453-
<tr><td colspan="4" class="doc" id="hasDependentName0"><pre>Matches the dependent name of a dependent scope decl ref expr.
3453+
<tr><td colspan="4" class="doc" id="hasDependentName0"><pre>Matches the dependent name of a DependentScopeDeclRefExpr.
34543454

3455-
Matches the dependent name of a dependent scope decl ref expr
3455+
Matches the dependent name of a DependentScopeDeclRefExpr
34563456

34573457
Given:
34583458

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3257,7 +3257,7 @@ AST_MATCHER_P(CXXDependentScopeMemberExpr, memberHasSameNameAsBoundNode,
32573257
});
32583258
}
32593259

3260-
/// Matches the dependent name of a dependent scope decl ref expr
3260+
/// Matches the dependent name of a DependentScopeDeclRefExpr
32613261
///
32623262
/// Given:
32633263
/// \code

clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,7 +2235,7 @@ TEST_P(ASTMatchersTest, ArgumentCountIs_CXXConstructExpr) {
22352235
Constructor1Arg));
22362236
}
22372237

2238-
TEST_P(ASTMatchersTest, hasDependentName_DependentScopeDeclRefExpr) {
2238+
TEST_P(ASTMatchersTest, HasDependentName_DependentScopeDeclRefExpr) {
22392239
if (!GetParam().isCXX() || GetParam().hasDelayedTemplateParsing()) {
22402240
// FIXME: Fix this test to work with delayed template parsing.
22412241
return;
@@ -2244,10 +2244,13 @@ TEST_P(ASTMatchersTest, hasDependentName_DependentScopeDeclRefExpr) {
22442244
EXPECT_TRUE(matches("template <class T> class X : T { void f() { T::v; } };",
22452245
dependentScopeDeclRefExpr(hasDependentName("v"))));
22462246

2247-
EXPECT_TRUE(
2248-
matches("template <typename T> struct S { static T Foo; };"
2249-
"template <typename T> void declToImport() { (void)S<T>::Foo; }",
2250-
dependentScopeDeclRefExpr(hasDependentName("Foo"))));
2247+
EXPECT_TRUE(matches("template <typename T> struct S { static T Foo; };"
2248+
"template <typename T> void x() { (void)S<T>::Foo; }",
2249+
dependentScopeDeclRefExpr(hasDependentName("Foo"))));
2250+
2251+
EXPECT_TRUE(matches("template <typename T> struct S { static T foo(); };"
2252+
"template <typename T> void x() { S<T>::foo; }",
2253+
dependentScopeDeclRefExpr(hasDependentName("foo"))));
22512254
}
22522255

22532256
TEST(ASTMatchersTest, NamesMember_CXXDependentScopeMemberExpr) {

0 commit comments

Comments
 (0)