aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-01-19 01:47:46 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-01-19 01:47:46 +0000
commit97e77abf8389e65f5eb935033cf1f71a69b4e00a (patch)
tree1ac3107672bf9bd930807e9dfc85ecb7a00616b4 /clang/lib
parente07d167a50165c85c4f440714bd2178e788f24b8 (diff)
downloadllvm-97e77abf8389e65f5eb935033cf1f71a69b4e00a.zip
llvm-97e77abf8389e65f5eb935033cf1f71a69b4e00a.tar.gz
llvm-97e77abf8389e65f5eb935033cf1f71a69b4e00a.tar.bz2
Revert r172878, "Reword warning about using a *static* variable within its own initialization."
It broke, at least, linux, msvc and mingw bots. llvm-svn: 172879
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index dbdbc3d..9cf5e73 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -6683,17 +6683,11 @@ namespace {
void VisitObjCMessageExpr(ObjCMessageExpr *E) { return; }
void HandleDeclRefExpr(DeclRefExpr *DRE) {
- Decl* ReferenceDecl = DRE->getDecl();
+ Decl* ReferenceDecl = DRE->getDecl();
if (OrigDecl != ReferenceDecl) return;
- unsigned diag;
- if (isReferenceType) {
- diag = diag::warn_uninit_self_reference_in_reference_init;
- } else if (cast<VarDecl>(OrigDecl)->isStaticLocal()) {
- diag = diag::warn_static_self_reference_in_init;
- } else {
- diag = diag::warn_uninit_self_reference_in_init;
- }
-
+ unsigned diag = isReferenceType
+ ? diag::warn_uninit_self_reference_in_reference_init
+ : diag::warn_uninit_self_reference_in_init;
S.DiagRuntimeBehavior(DRE->getLocStart(), DRE,
S.PDiag(diag)
<< DRE->getNameInfo().getName()