summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CloneDetection.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2016-08-23 16:42:00 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2016-08-23 16:42:00 +0000
commit5f94b089e91c9345e7c558a291bf653e9499bf4b (patch)
tree0342c59b11bbefed7d187066b678d042e9e373fd /clang/lib/Analysis/CloneDetection.cpp
parent036b94dad3fd736738931ced55e2f70525415e6f (diff)
downloadbcm5719-llvm-5f94b089e91c9345e7c558a291bf653e9499bf4b.tar.gz
bcm5719-llvm-5f94b089e91c9345e7c558a291bf653e9499bf4b.zip
[analyzer] Fix CloneDetector crash on calling methods of class templates.
If a call expression represents a method call of a class template, and the method itself isn't templated, then the method may be considered to be a template instantiation without template specialization arguments. No longer crash when we could not find template specialization arguments. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D23780 llvm-svn: 279529
Diffstat (limited to 'clang/lib/Analysis/CloneDetection.cpp')
-rw-r--r--clang/lib/Analysis/CloneDetection.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Analysis/CloneDetection.cpp b/clang/lib/Analysis/CloneDetection.cpp
index 9d11dabf964..a91ccaa4d2c 100644
--- a/clang/lib/Analysis/CloneDetection.cpp
+++ b/clang/lib/Analysis/CloneDetection.cpp
@@ -345,10 +345,9 @@ public:
DEF_ADD_DATA(CallExpr, {
// Function pointers don't have a callee and we just skip hashing it.
if (const FunctionDecl *D = S->getDirectCallee()) {
- // If the function is a template instantiation, we also need to handle
- // the template arguments as they are no included in the qualified name.
- if (D->isTemplateInstantiation()) {
- auto Args = D->getTemplateSpecializationArgs();
+ // If the function is a template specialization, we also need to handle
+ // the template arguments as they are not included in the qualified name.
+ if (auto Args = D->getTemplateSpecializationArgs()) {
std::string ArgString;
// Print all template arguments into ArgString
OpenPOWER on IntegriCloud