[cfe-dev] [PATCH] Libc++ Windows fixes

Ruben Van Boxem vanboxem.ruben at gmail.com
Sat Oct 22 14:38:25 PDT 2011


2011/10/22 Howard Hinnant <hhinnant at apple.com>

> On Oct 22, 2011, at 2:05 PM, Ruben Van Boxem wrote:
>
> >
> >
> > Attached is a patch to further improve the almost hopeless situation :)
>
> Thanks, Committed revision 142732.
>
> >
> > Also attached is a reduced (preprocessed) testcase (algorithm.cpp)
> producing exactly one of the template errors. The empty template parameter
> types in the error messages give the impression of a compiler bug, but I'm
> not quite sure yet. I tried running (MinGW-based) Clang on the preprocessed
> example, and if one ignores the missing builtin type related errors, one
> sees these decltype related errors:
>
> Sorry, I don't have any insights.  Compiler bug seems to me to be a good
> guess as your clang compiler appears to be fairly old (no rvalue refs, no
> variadics).
>

Yes, The no rvalue references is something I tried to get MSVC to compile
this. I ran Clang on the MSVC preprocessed reduced source. Essentially,
Clang (and mine's pretty current) fails to compile it as well. I fear the no
variadics code that's being used here is not quite right, or at least not in
its current syntactic form.

Thanks for the commit!

Ruben


> Howard
>
> >
> > [... other typedef related errors with nullptr, unsigned __int64, size_t
> etc...]
> > algorithm.cpp:140:22: error: expected parameter declarator
> >     typedef decltype(true ? __t() : __u()) type;
> >                      ^
> > algorithm.cpp:140:22: error: expected ')'
> > algorithm.cpp:140:21: note: to match this '('
> >     typedef decltype(true ? __t() : __u()) type;
> >                     ^
> > algorithm.cpp:140:13: error: C++ requires a type specifier for all
> declarations
> >     typedef decltype(true ? __t() : __u()) type;
> >     ~~~~~~~ ^
> > algorithm.cpp:140:43: error: expected ';' at end of declaration list
> >     typedef decltype(true ? __t() : __u()) type;
> >                                           ^
> >                                           ;
> > algorithm.cpp:144:1: error: C++ requires a type specifier for all
> declarations
> > decltype((std::declval<_Tp>() = std::declval<_Arg>(), true_type()))
> > ^~~~~~~~
> > algorithm.cpp:144:1: error: variable 'decltype' declared as a template
> > decltype((std::declval<_Tp>() = std::declval<_Arg>(), true_type()))
> > ^
> > algorithm.cpp:144:16: error: no member named 'declval' in namespace 'std'
> > decltype((std::declval<_Tp>() = std::declval<_Arg>(), true_type()))
> >           ~~~~~^
> > algorithm.cpp:144:24: error: '_Tp' does not refer to a value
> > decltype((std::declval<_Tp>() = std::declval<_Arg>(), true_type()))
> >                        ^
> > algorithm.cpp:143:17: note: declared here
> > template <class _Tp, class _Arg>
> >                 ^
> > algorithm.cpp:144:29: error: expected expression
> > decltype((std::declval<_Tp>() = std::declval<_Arg>(), true_type()))
> >                             ^
> > algorithm.cpp:144:38: error: no member named 'declval' in namespace 'std'
> > decltype((std::declval<_Tp>() = std::declval<_Arg>(), true_type()))
> >                                 ~~~~~^
> >
> > For once, these errors aren't really helpful :(, but they are radically
> different from the MSVC errors (see above, in my quoted email). I'm building
> a MSVC based Clang now, to see if it works better for libc++ (if at all).
> >
> > Thanks for any insights, comments or commits!
> >
> > Ruben
> >
> >
> > Comments and commits welcome!
> >
> > Ruben
> >
> > <msvc.patch.txt><algorithm.cpp>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111022/8435fe8f/attachment.html>


More information about the cfe-dev mailing list