We cannot forward declare a function inside a function.

This commit is contained in:
Vassil Vassilev 2013-10-01 15:02:24 +02:00 committed by sftnight
parent a9b71bb973
commit ffa77e6521

View File

@ -25,10 +25,10 @@ Result // CHECK: (cling::StoredValueRef) boxes [(cling::StoredValueRef &) &0x{{.
V // CHECK: (cling::StoredValueRef) boxes [(int *) 0x12]
// Savannah #96277
gCling->evaluate("double sin(double); double one = sin(3.141/2);", V);
gCling->evaluate("gCling->declare(\"double sin(double);\"); double one = sin(3.141/2);", V);
V // CHECK: (cling::StoredValueRef) boxes [(double) 1.000000e+00]
gCling->process("double sin(double); double one = sin(3.141/2);", &V);
gCling->process("double one = sin(3.141/2);", &V);
V // CHECK: (cling::StoredValueRef) boxes [(double) 1.000000e+00]
one // CHECK: (double) 1.000
int one; // expected-error {{redefinition of 'one' with a different type: 'int' vs 'double'}} expected-note {{previous definition is here}}