This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/57986] New: call to local "bind" template function called std::bind without "using" any namespace.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57986

            Bug ID: 57986
           Summary: call to local "bind" template function called
                    std::bind without "using" any namespace.
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yangzhe1990 at gmail dot com

Source codes are attached.

The compiling cmdline is:
  g++ numeric_utils_test.cpp -std=c++11 -o numeric_utils_test -g -pedantic
-Wall -Wextra -Wconversion -lpthread

I've defined a thread class, a bind function, a vector_iterator_asdf, a
computation function, and the multi-thread counterpart of the same function in
my own namespace.

In the multi-threaded function, it calls my thread(bind(single_thread_function,
params)). Then interesting thing happens: If I omit a parameter to the bind
function, the compiling error message shows that std::bind was called instead
of telling me it's impossible to find the right bind function. But I don't have
any "using namespace std" in my code.

The vector_iterator_asdf class is a iterator of multi-dimensional mathematical
vectors stored in an array.

It seems that <iterator> somehow depend on <functional> so that std::bind is
introduced.

More interesting thing is that: if I comment out the #include <algorithm> line,
the compiler returns to the correct behavior. Or if I don't have any
vector_iterator_asdf variables.

The more weird thing is: If I don't use any vector_iterator_asdf variables, and
don't #include <algorithm>, but create a temporary vector_iterator_asdf object,
call one of it's method, assign the return value to some other value, the
compiler behaves correctly.

I don't know why <iterator>, <algorithm> and my vector_iterator_asdf class
combined together could affect c++ function resolving.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]