aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-02-04 00:54:05 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-02-04 00:54:05 +0000
commit0cc5d40e5cb0af88c5487ac660ed259eb2b434ae (patch)
tree791cfe0a7d242ac180fd0216eb57bc2acfdadaf1 /lib/Sema/SemaExpr.cpp
parent5ba73e1af8ef519161bd40063dc325457e21676a (diff)
Suppress the used-but-not-defined warning for static data members while I look into a rather nasty bug in the new odr-use marking code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149731 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 8c49c537c5..3d8758e94e 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -9612,8 +9612,10 @@ void Sema::TryCaptureVar(VarDecl *var, SourceLocation loc,
static void MarkVarDeclODRUsed(Sema &SemaRef, VarDecl *Var,
SourceLocation Loc) {
// Keep track of used but undefined variables.
+ // FIXME: We shouldn't suppress this warning for static data members.
if (Var->hasDefinition() == VarDecl::DeclarationOnly &&
- Var->getLinkage() != ExternalLinkage) {
+ Var->getLinkage() != ExternalLinkage &&
+ !(Var->isStaticDataMember() && Var->hasInit())) {
SourceLocation &old = SemaRef.UndefinedInternals[Var->getCanonicalDecl()];
if (old.isInvalid()) old = Loc;
}