[Bug c++/63506] GCC deduces wrong return type of operator*() inside template functions

daniel.kruegler at googlemail dot com gcc-bugzilla@gcc.gnu.org
Sat Oct 11 09:58:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63506

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #4 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
Here is a complete example demonstrating the problem, which is also present in
gcc 5.0.0 20141010 (experimental):

//-------------------------------
struct proxy {};

struct iterator
{
  proxy operator*() { return proxy(); }
};

//#define DEACTIVATE

#ifndef DEACTIVATE
template<typename T = int>
#endif
void foo(iterator it)
{
  auto&& x = *it;
}

int main() 
{
  iterator it;
  foo(it);
}
//-------------------------------


More information about the Gcc-bugs mailing list