summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-02-21 19:25:48 +0000
committerJohn McCall <rjmccall@apple.com>2011-02-21 19:25:48 +0000
commit15dd404c467551a783ec7c9341b285403499a93a (patch)
tree20282d2e3ce0205ab080df4fab97a760a592c60f /clang/lib/Sema/SemaExpr.cpp
parent55820a6b7be9bafb08391adfba3bc12575a8cc6a (diff)
downloadbcm5719-llvm-15dd404c467551a783ec7c9341b285403499a93a.tar.gz
bcm5719-llvm-15dd404c467551a783ec7c9341b285403499a93a.zip
Don't warn about static const integral data members with in-line constant
initializers just because they don't have a proper out-of-line definition. Such code is technically ill-formed but is too common and too unlikely to be a problem to be seriously worth worrying about. llvm-svn: 126137
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 84baa7d9852..e7d167ed387 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -9336,9 +9336,12 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) {
}
}
- // Keep track of used but undefined variables.
+ // Keep track of used but undefined variables. We make a hole in
+ // the warning for static const data members with in-line
+ // initializers.
if (Var->hasDefinition() == VarDecl::DeclarationOnly
- && Var->getLinkage() != ExternalLinkage) {
+ && Var->getLinkage() != ExternalLinkage
+ && !(Var->isStaticDataMember() && Var->hasInit())) {
SourceLocation &old = UndefinedInternals[Var->getCanonicalDecl()];
if (old.isInvalid()) old = Loc;
}
OpenPOWER on IntegriCloud