From: Roman Lebedev Date: Wed, 30 Jan 2019 15:41:20 +0000 (+0000) Subject: [ASTDumper][OpenMP] CapturedDecl has a 'nothrow' bit X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d9557642df04ee319dc052954f56b3d00170af7;p=clang [ASTDumper][OpenMP] CapturedDecl has a 'nothrow' bit Summary: Was trying to understand how complicated it would be to write a clang-tidy `openmp-exception-escape`-ish check once D57100 lands. Just so it happens, all the data is already there, it is just conveniently omitted from AST dump. Reviewers: aaron.ballman, steveire, ABataev Reviewed By: ABataev Subscribers: ABataev, guansong, cfe-commits Tags: #openmp, #clang Differential Revision: https://reviews.llvm.org/D57452 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352631 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp index fd0870d4e7..369a2f17fb 100644 --- a/lib/AST/ASTDumper.cpp +++ b/lib/AST/ASTDumper.cpp @@ -727,6 +727,8 @@ void ASTDumper::VisitPragmaDetectMismatchDecl( } void ASTDumper::VisitCapturedDecl(const CapturedDecl *D) { + if (D->isNothrow()) + OS << " nothrow"; dumpStmt(D->getBody()); } diff --git a/test/AST/dump.cpp b/test/AST/dump.cpp index b460e9325e..d9ddca6672 100644 --- a/test/AST/dump.cpp +++ b/test/AST/dump.cpp @@ -61,7 +61,7 @@ struct S { // CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} 'int' // CHECK-NEXT: | | `-DeclRefExpr {{.+}} 'int' lvalue OMPCapturedExpr {{.+}} '.capture_expr.' 'int' // CHECK-NEXT: | `-CapturedStmt {{.+}} -// CHECK-NEXT: | |-CapturedDecl {{.+}} <> +// CHECK-NEXT: | |-CapturedDecl {{.+}} <> nothrow // CHECK-NEXT: | | |-ForStmt {{.+}} // CHECK: | | | `-UnaryOperator {{.+}} 'int' lvalue prefix '++' // CHECK-NEXT: | | | `-DeclRefExpr {{.+}} 'int' lvalue OMPCapturedExpr {{.+}} 'a' 'int &'