diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-01-19 01:47:46 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-01-19 01:47:46 +0000 |
commit | 97e77abf8389e65f5eb935033cf1f71a69b4e00a (patch) | |
tree | 1ac3107672bf9bd930807e9dfc85ecb7a00616b4 | |
parent | e07d167a50165c85c4f440714bd2178e788f24b8 (diff) | |
download | llvm-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
-rw-r--r-- | clang/include/clang/Basic/DiagnosticGroups.td | 4 | ||||
-rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 3 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 14 |
3 files changed, 5 insertions, 16 deletions
diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 8a2d596..24c4ef3b 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -259,9 +259,7 @@ def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">; def Unicode : DiagGroup<"unicode">; def UninitializedMaybe : DiagGroup<"conditional-uninitialized">; def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">; -def UninitializedStaticSelfInit : DiagGroup<"static-self-init">; -def Uninitialized : DiagGroup<"uninitialized", [UninitializedSometimes, - UninitializedStaticSelfInit]>; +def Uninitialized : DiagGroup<"uninitialized", [UninitializedSometimes]>; def UnknownPragmas : DiagGroup<"unknown-pragmas">; def UnknownWarningOption : DiagGroup<"unknown-warning-option">; def NSobjectAttribute : DiagGroup<"NSObject-attribute">; diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index c3f034a..c23d9ee 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -1292,9 +1292,6 @@ def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">, def warn_reference_field_is_uninit : Warning< "reference %0 is not yet bound to a value when used here">, InGroup<Uninitialized>; -def warn_static_self_reference_in_init : Warning< - "static variable %0 is suspiciously used within its own initialization">, - InGroup<UninitializedStaticSelfInit>; def warn_uninit_self_reference_in_init : Warning< "variable %0 is uninitialized when used within its own initialization">, InGroup<Uninitialized>; 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() |