diff --git a/parse.yy b/parse.yy index 6d58cebe..f742e72b 100644 --- a/parse.yy +++ b/parse.yy @@ -1435,7 +1435,8 @@ lAddFunctionParams(Declarator *decl) { Symbol *sym = pdecl->declarators[0]->GetSymbol(); #ifndef NDEBUG bool ok = m->symbolTable->AddVariable(sym); - assert(ok); // or error message? + if (ok == false) + assert(m->errorCount > 0); #else m->symbolTable->AddVariable(sym); #endif diff --git a/tests_errors/func-param-redeclare.ispc b/tests_errors/func-param-redeclare.ispc new file mode 100644 index 00000000..2b9075e4 --- /dev/null +++ b/tests_errors/func-param-redeclare.ispc @@ -0,0 +1,5 @@ +// Ignoring redeclaration of symbol "a" + +int foo(int a[], int a) { + return a[i]; +}