10#include "../utils/LexerUtils.h"
11#include "clang/AST/ASTContext.h"
12#include "clang/AST/Decl.h"
13#include "clang/ASTMatchers/ASTMatchFinder.h"
29 const auto *ProtoType =
FuncDecl->getType()->castAs<FunctionProtoType>();
30 const Expr *NoexceptExpr = ProtoType->getNoexceptExpr();
32 NoexceptExpr = NoexceptExpr->IgnoreImplicit();
33 if (!isa<CXXBoolLiteralExpr>(NoexceptExpr))
41 const SourceManager &SM = *Result.SourceManager;
43 const SourceLocation NoexceptLoc =
45 if (NoexceptLoc.isValid())
46 Diag << FixItHint::CreateInsertion(NoexceptLoc,
" noexcept ");
State analyze(const FunctionDecl *FuncDecl)
@ Throwing
This function has been declared as possibly throwing.
SourceLocation getLocationForNoexceptSpecifier(const FunctionDecl *FuncDecl, const SourceManager &SM)
For a given FunctionDecl returns the location where you would need to place the noexcept specifier.
static constexpr const char FuncDecl[]