aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
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;
}