summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index e0be9efe966..cc44c034eae 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -12660,9 +12660,15 @@ bool Sema::canSkipFunctionBody(Decl *D) {
// rest of the file.
// We cannot skip the body of a function with an undeduced return type,
// because any callers of that function need to know the type.
- if (const FunctionDecl *FD = D->getAsFunction())
- if (FD->isConstexpr() || FD->getReturnType()->isUndeducedType())
+ if (const FunctionDecl *FD = D->getAsFunction()) {
+ if (FD->isConstexpr())
return false;
+ // We can't simply call Type::isUndeducedType here, because inside template
+ // auto can be deduced to a dependent type, which is not considered
+ // "undeduced".
+ if (FD->getReturnType()->getContainedDeducedType())
+ return false;
+ }
return Consumer.shouldSkipFunctionBody(D);
}
OpenPOWER on IntegriCloud