summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clang-tidy/google/NonConstReferences.cpp3
-rw-r--r--clang-tools-extra/test/clang-tidy/google-runtime-references.cpp4
2 files changed, 7 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp b/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp
index 6e0fcfe529b..95dc708456a 100644
--- a/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp
+++ b/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp
@@ -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;
diff --git a/clang-tools-extra/test/clang-tidy/google-runtime-references.cpp b/clang-tools-extra/test/clang-tidy/google-runtime-references.cpp
index 2abd5afc75e..1ebbbe3fc86 100644
--- a/clang-tools-extra/test/clang-tidy/google-runtime-references.cpp
+++ b/clang-tools-extra/test/clang-tidy/google-runtime-references.cpp
@@ -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) {}
OpenPOWER on IntegriCloud