// Suggest possible initialization (if any).
const char *initialization = 0;
QualType vdTy = vd->getType().getCanonicalType();
-
+
if (vdTy->getAs<ObjCObjectPointerType>()) {
// Check if 'nil' is defined.
if (S.PP.getMacroInfo(&S.getASTContext().Idents.get("nil")))
initialization = " = 0.0";
else if (vdTy->isBooleanType() && S.Context.getLangOptions().CPlusPlus)
initialization = " = false";
+ else if (vdTy->isEnumeralType())
+ continue;
else if (vdTy->isScalarType())
initialization = " = 0";
return x; // expected-warning{{variable 'x' is possibly uninitialized when used here}}
}
+enum test4_A {
+ test4_A_a, test_4_A_b
+};
+test4_A test4() {
+ test4_A a; // expected-note{{variable 'a' is declared here}}
+ return a; // expected-warning{{variable 'a' is possibly uninitialized when used here}}
+}
+