aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpptools/cppchecksymbols.cpp
diff options
context:
space:
mode:
authorAdam Strzelecki <[email protected]>2015-10-20 20:12:09 +0200
committerOrgad Shaneh <[email protected]>2015-11-16 10:18:05 +0000
commit9b3723d6f4c3aa0455f9e4de8d0edfac4edf6371 (patch)
tree51ff37a710a8cdabc9cd4a5e0c2a998e36dcc6f8 /src/plugins/cpptools/cppchecksymbols.cpp
parent87f6b92e340b085a88ffca724a11e62249a8ccde (diff)
CppTools: Do not highlight instantiation as call
Underlying C++ model sometimes marks C++ object instantiation using initializer as a (forward) function declaration. This leads to incorrect highlighting of object variables as if they were function calls. C++ model however marks in this case (and not any other case) such symbols as ambiguous function types, see CPlusPlus::Bind::visit. This change skips such ambiguous functions for highlighting as function call. Also add test case for related bug report. Task-number: QTCREATORBUG-15212 Change-Id: Ifde8db407f2fa8275a3f991bfa3d3b73eca8c14e Reviewed-by: Orgad Shaneh <[email protected]> Reviewed-by: Nikolai Kosjar <[email protected]>
Diffstat (limited to 'src/plugins/cpptools/cppchecksymbols.cpp')
-rw-r--r--src/plugins/cpptools/cppchecksymbols.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppchecksymbols.cpp b/src/plugins/cpptools/cppchecksymbols.cpp
index dccab54dc54..acf3d5c86f6 100644
--- a/src/plugins/cpptools/cppchecksymbols.cpp
+++ b/src/plugins/cpptools/cppchecksymbols.cpp
@@ -1298,7 +1298,7 @@ bool CheckSymbols::maybeAddFunction(const QList<LookupItem> &candidates, NameAST
Function *funTy = c->type()->asFunctionType();
if (!funTy) // Template function has an overridden type
funTy = r.type()->asFunctionType();
- if (!funTy)
+ if (!funTy || funTy->isAmbiguous())
continue; // TODO: add diagnostic messages and color call-operators calls too?
if (argumentCount < funTy->minimumArgumentCount()) {