Index: lib/Sema/SemaOpenMP.cpp =================================================================== --- lib/Sema/SemaOpenMP.cpp +++ lib/Sema/SemaOpenMP.cpp @@ -6050,6 +6050,13 @@ assert(isa(AStmt) && "Captured statement expected"); + // 1.2.2 OpenMP Language Terminology + // Structured block - An executable statement with a single entry at the + // top and a single exit at the bottom. + // The point of exit cannot be a branch out of the structured block. + // longjmp() and throw() must not violate the entry/exit criteria. + cast(AStmt)->getCapturedDecl()->setNothrow(); + setFunctionHasBranchProtectedScope(); return OMPMasterDirective::Create(Context, StartLoc, EndLoc, AStmt); Index: test/AST/ast-dump-openmp-master.cpp =================================================================== --- /dev/null +++ test/AST/ast-dump-openmp-master.cpp @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -verify -fopenmp -ast-dump %s | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp-simd -ast-dump %s | FileCheck %s +// expected-no-diagnostics + +void master() { +#pragma omp master + { + } +} + +// CHECK: `-FunctionDecl +// CHECK-NEXT: `-CompoundStmt +// CHECK-NEXT: `-OMPMasterDirective +// CHECK-NEXT: `-CapturedStmt +// CHECK-NEXT: `-CapturedDecl {{.*}} nothrow +// CHECK-NEXT: |-CompoundStmt +// CHECK-NEXT: `-ImplicitParamDecl