summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/store/constantfunction.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/store/constantfunction.cxx')
-rw-r--r--compilerplugins/clang/store/constantfunction.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/compilerplugins/clang/store/constantfunction.cxx b/compilerplugins/clang/store/constantfunction.cxx
index cd14c48d981a..20f69712fa07 100644
--- a/compilerplugins/clang/store/constantfunction.cxx
+++ b/compilerplugins/clang/store/constantfunction.cxx
@@ -67,6 +67,12 @@ bool ConstantFunction::VisitFunctionDecl(const FunctionDecl * pFunctionDecl) {
if (pFunctionDecl->isExternC()) {
return true;
}
+ if (pFunctionDecl->isConstexpr()) {
+ return true;
+ }
+ if (pFunctionDecl->isMain()) {
+ return true;
+ }
StringRef aFileName = getFilename(pFunctionDecl);
@@ -151,7 +157,6 @@ bool ConstantFunction::VisitFunctionDecl(const FunctionDecl * pFunctionDecl) {
if (isa<CXXConstructorDecl>(pFunctionDecl) || isa<CXXDestructorDecl>(pFunctionDecl) || isa<CXXConversionDecl>(pFunctionDecl)) {
return true;
}
- SourceLocation canonicalLoc = pFunctionDecl->getCanonicalDecl()->getNameInfo().getLoc();
if (isInUnoIncludeFile(pFunctionDecl)) {
return true;
}
@@ -429,6 +434,7 @@ bool ConstantFunction::VisitFunctionDecl(const FunctionDecl * pFunctionDecl) {
+
std::string aImmediateMacro = "";
if (compiler.getSourceManager().isMacroBodyExpansion(pFunctionDecl->getLocStart()) ) {
StringRef name { Lexer::getImmediateMacroName(