Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions regression/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
DIRS = ansi-c \
cbmc \
cbmc-cover \
cbmc-cpp \
cbmc-java \
cbmc-java-inheritance \
cpp \
Expand Down
12 changes: 12 additions & 0 deletions regression/cbmc-cpp/FunctionParam1/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <assert.h>
int x;

void g(int i){
x=i;
}

int main() {
g(3);
assert(x==3);
}

8 changes: 8 additions & 0 deletions regression/cbmc-cpp/FunctionParam1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
main.cpp

^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
18 changes: 18 additions & 0 deletions regression/cbmc-cpp/MethodParam1/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <assert.h>
unsigned x;

class ct {
void f(int i) {
x=x+i;
}
};

int main() {
unsigned r;
x=r%3;
ct c;
c.f(2);
assert(x<4);
assert(x<5);
}

10 changes: 10 additions & 0 deletions regression/cbmc-cpp/MethodParam1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CORE
main.cpp

instance is SATISFIABLE$
instance is UNSATISFIABLE$
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
^warning: ignoring
1 change: 1 addition & 0 deletions regression/cbmc-cpp/union2/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <assert.h>
struct A
{
union
Expand Down
3 changes: 2 additions & 1 deletion src/cpp/cpp_typecheck_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ void cpp_typecheckt::convert_parameter(
symbol.type=parameter.type();
symbol.is_state_var=true;
symbol.is_lvalue=!is_reference(symbol.type);
symbol.is_parameter=true;

assert(!symbol.base_name.empty());
INVARIANT(!symbol.base_name.empty(), "parameter has base name");

symbolt *new_symbol;

Expand Down