Summary: Applying it produces incorrect code at the moment.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: kuhnel, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68630
llvm-svn: 374048
if (auto *Node = Inputs.ASTSelection.commonAncestor()) {
if (auto *TypeNode = Node->ASTNode.get<TypeLoc>()) {
if (const AutoTypeLoc Result = TypeNode->getAs<AutoTypeLoc>()) {
- CachedLocation = Result;
+ // Code in apply() does handle 'decltype(auto)' yet.
+ if (!Result.getTypePtr()->isDecltypeAuto())
+ CachedLocation = Result;
}
}
}
// replace array types
EXPECT_EQ(apply(R"cpp(au^to x = "test")cpp"),
R"cpp(const char * x = "test")cpp");
+
+ EXPECT_UNAVAILABLE("dec^ltype(au^to) x = 10;");
}
TWEAK_TEST(ExtractFunction);