
Tsuna <tsuna@warszawa.lrde.epita.fr> writes:
On 2006-11-03, Roland Levillain <roland@lrde.epita.fr> wrote:
Roland Levillain <roland@lrde.epita.fr> writes:
[...]
Index: mlc/is_a.hh =================================================================== --- mlc/is_a.hh (révision 693) +++ mlc/is_a.hh (révision 694) @@ -240,11 +240,11 @@
# define mlc_is_a(T, U) \ mlc::wrap_< \ - typename mlc::is_a_< sizeof(mlc::form::of< U >()) >::template ret< typename mlc::basic_<T>::ret, U > \ + typename mlc::is_a_< sizeof(mlc::form::of< U >()) >::template ret< typename mlc::basic_< T >::ret, U > \
# define mlc_is_a_(T, U) \ -mlc::is_a_< sizeof(mlc::form::of< U >()) >::ret< mlc::basic_<T>::ret, U > +mlc::is_a_< sizeof(mlc::form::of< U >()) >::ret< mlc::basic_< T >::ret, U >
[SNIP]
What's the problem with icpc? Why does it actually *need* whitespaces there?
Indeed. % cat icpc-macro-issue.cc template <typename T> struct Foo { }; /* Icpc chokes when expanding this macro when T is a template type: T is substituted with no additional surrounding space, generating a token `>>'. G++ has no such problem, but I haven't checked which is the right behavior, required by the ISO standard. Note that this will no longer be a problem with C++ 0x, since expressions like `Foo<Foo<int>>' will be valid. */ #define foo(T) Foo<T> int main () { foo(Foo<int>) f; } % icpc -gcc-name=gcc-4.0 -o icpc-macro-issue icpc-macro-issue.cc icpc-macro-issue.cc(20): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator) foo(Foo<int>) f; ^ compilation aborted for icpc-macro-issue.cc (code 2) % g++ -o icpc-macro-issue icpc-macro-issue.cc %