Re: [Olena-patches] 694: Add spaces in macros to please icpc.

On 2006-11-04, Roland Levillain <roland@lrde.epita.fr> wrote:
% 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 %
Ah bah oui, j'avais pas pense a ça mais le problème est évident. -- SIGOURE Benoit aka Tsuna (SUSv3 compliant) _____ "On a long enough timeline, the survival rate /EPITA\ Promo 2008.CSI/ACU for everyone drops to zero" -- Jack.
participants (1)
-
Tsuna