summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-11-23 13:38:32 +0100
committerChristian Kamm <christian.d.kamm@nokia.com>2011-11-23 13:52:23 +0100
commitc0cebf97355237316d7797ffc226fa001144f581 (patch)
tree0bfbd591ac0ecd6a2d1a01ab472cdf1b517cd5eb /src
parent60830e000bce3fefa7d0d3adf15e8d57fb7e9f55 (diff)
downloadqt-creator-c0cebf97355237316d7797ffc226fa001144f581.tar.gz
C++ function signature: Avoid hitting a QTC_ASSERT.
Change-Id: I0390e51a7d1fc4563eed791c9f8c8ed403398663 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/cppeditor/cppfunctiondecldeflink.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
index 61c097eaa9..2ca413e331 100644
--- a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
+++ b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
@@ -667,10 +667,12 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
// make a easy to access list of the target parameter declarations
QVarLengthArray<ParameterDeclarationAST *, 10> targetParameterDecls;
- QTC_ASSERT(targetFunctionDeclarator->parameter_declaration_clause, return changes);
- for (ParameterDeclarationListAST *it = targetFunctionDeclarator->parameter_declaration_clause->parameter_declaration_list;
- it; it = it->next) {
- targetParameterDecls.append(it->value);
+ // there is no parameter declaration clause if the function has no arguments
+ if (targetFunctionDeclarator->parameter_declaration_clause) {
+ for (ParameterDeclarationListAST *it = targetFunctionDeclarator->parameter_declaration_clause->parameter_declaration_list;
+ it; it = it->next) {
+ targetParameterDecls.append(it->value);
+ }
}
// the number of parameters in sourceFunction or targetFunction