@Axel This works fine in ROOT 5.34.
This is a new problem in ROOT 6 (6.14/00, 6.12/06, …, Ubuntu 14.04 / x86_64 / gcc 4.8.4).
I get:
root [0] .x test.cxx
We got AFTER Double_t X?
We got AFTER Double_t Y?
root [1] .q
from the unnamed macro “test.cxx”:
{
return; // try to comment out this line and rerun this macro
std::cout << "We start ..." << std::endl;
return;
std::cout << "We got BEFORE Double_t X?" << std::endl;
Double_t X; // try to comment out this line and rerun this macro
std::cout << "We got AFTER Double_t X?" << std::endl;
return;
std::cout << "We got BEFORE Double_t X?" << std::endl;
Double_t Y; // try to comment out this line and rerun this macro
std::cout << "We got AFTER Double_t Y?" << std::endl;
}
A “brutal fix” for the moment, which seems to work, is to define ALL VARIABLES (appearing in an “unnamed macro”) right in the beginning of this macro (i.e. before any “return;” statement).