diff options
author | Anders Carlsson <andersca@mac.com> | 2010-02-06 05:31:15 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-02-06 05:31:15 +0000 |
commit | 4855a52d2a4598883deafefea9029f454a4343ee (patch) | |
tree | 9ef6e51ef28f42794d85dd669f06ecef7d8a21ff /lib/Sema/SemaChecking.cpp | |
parent | a9a55c063e9e59c6ab0a6d7a21302660f7bde9f9 (diff) |
Don't diagnose missing noreturns for uninstantiated templates. Fixes PR6247.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95487 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 76ff8dc7cb..52a5162476 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -2494,10 +2494,11 @@ void Sema::CheckFallThroughForFunctionDef(Decl *D, Stmt *Body, bool ReturnsVoid = false; bool HasNoReturn = false; if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { - // If the result type of the function is a dependent type, we don't know - // whether it will be void or not, so don't - if (FD->getResultType()->isDependentType()) + // For function templates, class templates and member function templates + // we'll do the analysis at instantiation time. + if (FD->isDependentContext()) return; + if (FD->getResultType()->isVoidType()) ReturnsVoid = true; if (FD->hasAttr<NoReturnAttr>() || |