clang-reflect icon indicating copy to clipboard operation
clang-reflect copied to clipboard

Address reflection for variables is broken

Open asutton opened this issue 7 years ago • 1 comments

The value printed by the following function is garbage.

int var = 42;
int main() {
  constexpr variable_info v = reflexpr(var);
  printf("%d\n", v.get<int>());
}

asutton avatar Aug 10 '17 14:08 asutton

I think this might be computing the symbol address and then dereferencing that. We probably want to extract the variable or string computed by the immediate call and then return the address of that object.

asutton avatar Aug 10 '17 15:08 asutton