[clang-tidy] Don't emit google-runtime-references warning for functions defined in macros.

Summary:
The macro are usually defined in the common/base headers which are hard
for normal users to modify it.

Reviewers: gribozavr, alexfh

Subscribers: xazax.hun, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66631

llvm-svn: 369739
This commit is contained in:
Haojian Wu 2019-08-23 08:47:27 +00:00
parent 6ef01c3e2b
commit c4905a232c
2 changed files with 7 additions and 0 deletions

View File

@ -52,6 +52,9 @@ void NonConstReferences::check(const MatchFinder::MatchResult &Result) {
if (Function == nullptr || Function->isImplicit())
return;
if (Function->getLocation().isMacroID())
return;
if (!Function->isCanonicalDecl())
return;

View File

@ -149,3 +149,7 @@ void f8(B &);
}
void f9(whitelist::A &);
void f10(whitelist::B &);
#define DEFINE_F(name) void name(int& a)
DEFINE_F(func) {}