summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2014-10-11 00:24:15 +0000
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2014-10-11 00:24:15 +0000
commit4b5ca9a22270c8b613f4bd9b4e4563fb0b86a1d6 (patch)
treec101114246c86c7f308b3ddda7e6e42651fb3a1e /clang/lib/Sema
parent6666c27e992ac77c64cd49318a0f43a5dcef3de8 (diff)
downloadbcm5719-llvm-4b5ca9a22270c8b613f4bd9b4e4563fb0b86a1d6.tar.gz
bcm5719-llvm-4b5ca9a22270c8b613f4bd9b4e4563fb0b86a1d6.zip
clang-cl: Don't warn for unused private fields when encountering a late parsed template member
Summary: This fixes PR21235. Test Plan: Includes an automated test. Reviewers: hansw Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5718 llvm-svn: 219551
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/Sema.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 7ecd41697d6..aae2008957e 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -545,7 +545,12 @@ static bool MethodsAndNestedClassesComplete(const CXXRecordDecl *RD,
if (const CXXMethodDecl *M = dyn_cast<CXXMethodDecl>(*I))
Complete = M->isDefined() || (M->isPure() && !isa<CXXDestructorDecl>(M));
else if (const FunctionTemplateDecl *F = dyn_cast<FunctionTemplateDecl>(*I))
- Complete = F->getTemplatedDecl()->isDefined();
+ // If the template function is marked as late template parsed at this point,
+ // it has not been instantiated and therefore we have not performed semantic
+ // analysis on it yet, so we cannot know if the type can be considered
+ // complete.
+ Complete = !F->getTemplatedDecl()->isLateTemplateParsed() &&
+ F->getTemplatedDecl()->isDefined();
else if (const CXXRecordDecl *R = dyn_cast<CXXRecordDecl>(*I)) {
if (R->isInjectedClassName())
continue;
OpenPOWER on IntegriCloud