id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 9606,Boost.LocalFunction cannot bind pointer variables by reference on gcc/clang,e4lam@…,Lorenzo Caminiti,"Boost.LocalFunction cannot bind pointer variables by reference on gcc or clang. I have tested this against the latest boost code available in version 1.55.0 and r86799. I have tested that it works on Visual Studio though but not on gcc 4.1 (Linux), 4.6 (Linux), nor clang 5.0 (OSX). Here's the test {{{ // Example compile: g++ -I /usr/local/include/boost_1_55_0 -o bug bug.cpp #include #include int main() { int x = 1; int *px = &x; void BOOST_LOCAL_FUNCTION(bind& px, bind& x) { printf(""INSIDE: &px = %p, &x = %p\n"", &px, &x); } BOOST_LOCAL_FUNCTION_NAME(fubar) printf(""OUTSIDE: &px = %p, &x = %p\n"", &px, &x); fubar(); return 0; } }}} The pointer values output by this program should be identical for both the INSIDE and OUTSIDE cases. Notice that value for &px differs. I found some ways to sort of make this work but none of them are acceptable workarounds for me: - Binding pointer variables works perfectly in Boost.ScopeExit for all compilers/platforms that I tested - Adding ""-std=c++0x"" to the compiler line also fixes the problem ",Bugs,new,To Be Determined,local function,Boost Development Trunk,Problem,,,