Index: clang/lib/CodeGen/CGStmtOpenMP.cpp =================================================================== --- clang/lib/CodeGen/CGStmtOpenMP.cpp +++ clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -1732,8 +1732,8 @@ const SourceRange R = S.getSourceRange(); // If attributes are attached, push to the basic block with them. - const OMPExecutableDirective *OMPED = dyn_cast(&S); - const CapturedStmt *ICS = OMPED->getInnermostCapturedStmt(); + const auto &OMPED = cast(S); + const CapturedStmt *ICS = OMPED.getInnermostCapturedStmt(); const Stmt *SS = ICS->getCapturedStmt(); const AttributedStmt *AS = dyn_cast_or_null(SS); if (AS) Index: clang/test/OpenMP/omp_with_loop_pragma.c =================================================================== --- clang/test/OpenMP/omp_with_loop_pragma.c +++ clang/test/OpenMP/omp_with_loop_pragma.c @@ -3,12 +3,12 @@ // expected-no-diagnostics // CHECK: !{{[0-9]+}} = !{!"llvm.loop.vectorize.width", i32 1} -void sub(double * restrict a, double * restrict b, int n){ +void sub(double *restrict a, double *restrict b, int n) { int i; #pragma omp parallel for #pragma clang loop vectorize(disable) - for(i=0;i