On Thu, 11 Aug 2011, Rainer Orth wrote:

I could, but am a bit reluctant to do so since such a fix feels quite
fragile, and `fixes' the Solaris headers in many places where they are
completely correct.  I'll also have to touch <time.h>, <wchar.h>,
<stdlib.h>, and <locale.h>, that all have using std::tm etc. clauses.

Actually, you wouldn't need to touch those other places:

struct tm;
namespace std { using ::tm; }
using std::tm;

is perfectly ok, so it would really be only the four struct declarations.

(I am not saying that against your proposal below at all, just making sure we understand the issue)

There might be an alternative implementation that is less invasive to
the C++ frontend, though: add

        && TARGET_DECL_NAMESPACE_STD_P (decl)

in write_unscoped_name, defaulting to true, override it in sol2.h (which
gets included via tm.h) and have the remaining logic in a new sol2-cxx.c
file.  This way, the impact on the C++ frontend is minimal and we don't
have to resort to fragile fixincludes hacks.

--
Marc Glisse

Reply via email to