id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 1719,[addressof] Can't obtain the address of an instance of an anonymous struct,Jean-François Bastien ,Peter Dimov,"I sent this to the Boost-users mailing list but got no feedback to validate the issue, but the bottom line is that there's a problem and I'd like addressof to offer a workaround if it's possible. We're running into an issue with addressof as described at: https://savannah.cern.ch/bugs/?33071 Basically this fails under GCC 3.4.4 as well as GCC 4.3: {{{ struct // NoName { } noName; void * fail() { return addressof(noName); } }}} The error message is ""{{{no matching function for call to `addressof(&)'}}}"". MSVC 2005 SP1 compiles and runs this with no problem. The problem seems to be that GCC can't deduce the templated type because the struct is anonymous. I'm not sure whether this is because it's non-standard behavior that MSVC accepts and GCC doesn't or because GCC has a bug. Either way it would be nice if addressof had a workaround for the ""broken"" GCC versions, but I'm not sure what the best workaround would be. Axel suggested in the above link to C-style cast to char &, but this causes a problem in the (unlikely) event where operator char &() is declared in the anonymous struct. We could use template magic to see if operator char &() is declared, but I'm not very comfortable with such a huge workaround. If the discussion points towards a bug in GCC I'll file a bug report with them, but either way addressof isn't working with GCC 3.4.4 and 4.3 (at least), and it would be nice of Boost to offer a workaround. ",Bugs,closed,Boost 1.36.0,None,Boost 1.34.1,Problem,invalid,,