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 | 96c15b1816d8d3381c9fd04a3b9fdafc96242dfe (patch) | |
tree | 5f0041b5b74bc9660e30d9e9571dac81559789a5 /clang/lib/Sema/SemaChecking.cpp | |
parent | 61f6db54e152f1d42b37789bf74a9c13d2aa40a5 (diff) | |
download | bcm5719-llvm-96c15b1816d8d3381c9fd04a3b9fdafc96242dfe.tar.gz bcm5719-llvm-96c15b1816d8d3381c9fd04a3b9fdafc96242dfe.zip |
Don't diagnose missing noreturns for uninstantiated templates. Fixes PR6247.
llvm-svn: 95487
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 76ff8dc7cb9..52a51624765 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/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>() || |