summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2010-02-01 20:16:42 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2010-02-01 20:16:42 +0000
commit5ca7984bb4fe32623d40a7f1cd9691eb21eb3560 (patch)
tree4d37fae6578972f9b67ea61d617bffc1c0a1c317 /clang/lib/Sema/SemaChecking.cpp
parentb18093e4675655be85226f03aeaba2081c09ddf5 (diff)
downloadbcm5719-llvm-5ca7984bb4fe32623d40a7f1cd9691eb21eb3560.tar.gz
bcm5719-llvm-5ca7984bb4fe32623d40a7f1cd9691eb21eb3560.zip
In C++, an initializer on a variable doesn't necessarily mean it's the definition. With that in mind, rename getDefinition to getAnyInitializer (to distinguish it from getInit) and reimplement it in terms of isThisDeclarationADefinition. Update all code to use this new function.
llvm-svn: 94999
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 399979fc1ea..c6b826b3270 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -846,8 +846,7 @@ bool Sema::SemaCheckStringLiteral(const Expr *E, const CallExpr *TheCall,
}
if (isConstant) {
- const VarDecl *Def = 0;
- if (const Expr *Init = VD->getDefinition(Def))
+ if (const Expr *Init = VD->getAnyInitializer())
return SemaCheckStringLiteral(Init, TheCall,
HasVAListArg, format_idx, firstDataArg);
}
OpenPOWER on IntegriCloud