Index: clang/lib/Sema/AnalysisBasedWarnings.cpp =================================================================== --- clang/lib/Sema/AnalysisBasedWarnings.cpp +++ clang/lib/Sema/AnalysisBasedWarnings.cpp @@ -864,7 +864,7 @@ /// false. static bool DiagnoseUninitializedUse(Sema &S, const VarDecl *VD, const UninitUse &Use, - bool alwaysReportSelfInit = false) { + bool alwaysReportSelfInit = false) { if (const DeclRefExpr *DRE = dyn_cast(Use.getUser())) { // Inspect the initializer of the variable declaration which is // being referenced prior to its initialization. We emit @@ -891,6 +891,11 @@ } } + // If volatile, we don't raise this warning. + if (VD->getType().isVolatileQualified()) { + return false; + } + DiagUninitUse(S, VD, Use, false); } else { const BlockExpr *BE = cast(Use.getUser());