summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2018-01-12 04:42:27 +0000
committerRichard Trieu <rtrieu@google.com>2018-01-12 04:42:27 +0000
commit4eefb4511de5dccb95cd5e3e43340503f5259e31 (patch)
tree15b13bde629b3724cdd669c65b59ed961df9baf4 /clang/lib/AST
parent64a0db76f96e7178deb09bd0d776042f8c771bc5 (diff)
downloadbcm5719-llvm-4eefb4511de5dccb95cd5e3e43340503f5259e31.tar.gz
bcm5719-llvm-4eefb4511de5dccb95cd5e3e43340503f5259e31.zip
[ODRHash] Don't hash friend functions.
In certain combinations of templated classes and friend functions, the body of friend functions does not get propagated along with function signature. Exclude friend functions for hashing to avoid this case. llvm-svn: 322350
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ODRHash.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/ODRHash.cpp b/clang/lib/AST/ODRHash.cpp
index 088d8bedd45..38e8d34135f 100644
--- a/clang/lib/AST/ODRHash.cpp
+++ b/clang/lib/AST/ODRHash.cpp
@@ -478,6 +478,8 @@ void ODRHash::AddFunctionDecl(const FunctionDecl *Function) {
// TODO: Fix hashing for class methods.
if (isa<CXXMethodDecl>(Function)) return;
+ // And friend functions.
+ if (Function->getFriendObjectKind()) return;
// Skip functions that are specializations or in specialization context.
const DeclContext *DC = Function;
OpenPOWER on IntegriCloud