It broke, at least, linux, msvc and mingw bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172879
91177308-0d34-0410-b5e6-
96231b3b80d8
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">;
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>;
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()