https://llvm.org/bugs/show_bug.cgi?id=30331
Bug ID: 30331
Summary: hasDeclaration matcher doesn't match QualType wrapping
ElaboratedType or TemplateSpecializationType
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
This test fails at ToT:
TEST(HasDeclaration, QualTypeSpecializedTypeAndTemplateSpecializationType) {
std::string input =
"namespace Namespace {\n"
"template<typename T>\n"
"class Template {\n"
" public:\n"
" void Method() {}\n"
"};\n"
"} // namespace Namespace\n"
"template <typename U>\n"
"void Function(Namespace::Template<U> param) {\n"
" param.Method();\n"
"};\n";
// hasDeclaration should see through:
// 1. from ElaboratedType (Namespace::MyTemplate<U>) to
// TemplateSpecializationType (MyTemplate<U>)
// 2. from TemplateSpecializationType (MyTemplate<U>)
// to TemplateDecl (MyTemplate<T>).
EXPECT_TRUE(matches(input, parmVarDecl(
hasName("param"),
hasType(qualType(hasDeclaration(decl(anything())))))));
}
The test failure is unexpected, because a parmVarDecl's type should always have
a declaration (right?).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs