From bb5093fefdf6c3944e17e5ce2951be5bb5cb49aa Mon Sep 17 00:00:00 2001 From: Samuel Benzaquen Date: Fri, 6 Mar 2015 16:24:47 +0000 Subject: Fix isOverride() for the case of a dependent typed base class. The method decl is not marked as overriding any other method decls until the template is instantiated. Use the override attribute as another signal. llvm-svn: 231487 --- clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp') diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 0d27b5db034..dab22e33cda 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -1790,6 +1790,9 @@ TEST(Matcher, MatchesOverridingMethod) { methodDecl(isOverride()))); EXPECT_TRUE(notMatches("class X { int f(); int f(int); }; ", methodDecl(isOverride()))); + EXPECT_TRUE( + matches("template struct Y : Base { void f() override;};", + methodDecl(isOverride(), hasName("::Y::f")))); } TEST(Matcher, ConstructorCall) { -- cgit v1.2.3