r243111 - Correcting some comments. (1) the function is named throughUsingDecl() and not throughUsingDeclaration(). (2) Testing shows that this does work for shadowed variables as well as shadowed functions. I could not find an example where this matcher was failing. NFC.

Aaron Ballman aaron at aaronballman.com
Fri Jul 24 08:47:33 PDT 2015


Author: aaronballman
Date: Fri Jul 24 10:47:32 2015
New Revision: 243111

URL: http://llvm.org/viewvc/llvm-project?rev=243111&view=rev
Log:
Correcting some comments. (1) the function is named throughUsingDecl() and not throughUsingDeclaration(). (2) Testing shows that this does work for shadowed variables as well as shadowed functions. I could not find an example where this matcher was failing. NFC.

Modified:
    cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h

Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h?rev=243111&r1=243110&r2=243111&view=diff
==============================================================================
--- cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h (original)
+++ cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h Fri Jul 24 10:47:32 2015
@@ -2367,8 +2367,6 @@ AST_MATCHER_P(DeclRefExpr, to, internal:
 /// \brief Matches a \c DeclRefExpr that refers to a declaration through a
 /// specific using shadow declaration.
 ///
-/// FIXME: This currently only works for functions. Fix.
-///
 /// Given
 /// \code
 ///   namespace a { void f() {} }
@@ -2378,7 +2376,7 @@ AST_MATCHER_P(DeclRefExpr, to, internal:
 ///     a::f();  // .. but not this.
 ///   }
 /// \endcode
-/// declRefExpr(throughUsingDeclaration(anything()))
+/// declRefExpr(throughUsingDecl(anything()))
 ///   matches \c f()
 AST_MATCHER_P(DeclRefExpr, throughUsingDecl,
               internal::Matcher<UsingShadowDecl>, InnerMatcher) {





More information about the cfe-commits mailing list