clang ignoring global function declaration depending on include/declaration order

Hello!

I have a problem compiling a code with clang (3.0) that worked with
gcc-4.2. I found this thread
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-June/015527.html and this
is exactly the problem I have. Unfortunately, I don't understand how I
should change the (source) code. It would be great if you can send me a
small example that would compile with gcc, but not with clang and how you
have to improve it that it will compile with clang as well [if you got this
error message: call to function 'operator<<' that is neither visible in the
template definition nor found by argument dependent lookup]. That would be
of great help.

Thank you very much!
Best regards,
Aila Gengelbach

Hi,

I have a problem compiling a code with clang (3.0) that worked with
gcc-4.2. I found this thread
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-June/015527.html and this
is exactly the problem I have.

Did you find/read the linked article from that post (
http://clang.llvm.org/compatibility.html#dep_lookup ) it seems pretty
comprehensive.

Unfortunately, I don't understand how I
should change the (source) code. It would be great if you can send me a
small example that would compile with gcc, but not with clang and how you
have to improve it that it will compile with clang as well [if you got this
error message: call to function 'operator<<' that is neither visible in the
template definition nor found by argument dependent lookup]. That would be
of great help.

Beyond the examples given on the compatibility page I'm not sure what
other general advice I can offer. Have a read over it & if you have
other questions it would be helpful if you could provide an example
you are grappling with.

- David