On Thu, 23 Oct 2014, John Peterson wrote:

> We came across this issue in one of our applications with clang 3.5.0.
> The following code compiles just fine in "C++03" mode, but fails in
> "C++11" mode.  Is clang right here, or is it a compiler bug?

http://www.cplusplus.com/reference/ios/ios/operator_bool/

So in C++11, there should be an implicit conversion to bool *if* the
conversion gets forced by the return type.  (if you use "auto" then
operator= just tries to copy the stream which IIRC isn't allowed)

In C++03 the conversion is to void*, but I suppose the compiler is
figuring out that it can do a chain of conversions by then going from
void* to bool?  I forger under what circumstances that's allowed.

The version as-is should be working in C++11, I believe.

I wouldn't swear that this was a compiler bug, though: you're mixing
clang with libstdc++, right?  This could be another one of those
"libstdc++ tries to detect internal gcc preprocessor tokens and gets
confused by clang" bugs.
---
Roy

------------------------------------------------------------------------------
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to