This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

26_numerics/c99_classification_macros_c++.cc fails on cygwin


Test 26_numerics/c99_classification_macros_c++.cc fails on cygwin. 
I have reduced the problem, but don't understand what's happening.

The reduced test case is

#include <cmath>
void fpclassify() { }

which fails with 

bug.cc:2: error: expected unqualified-id
bug.cc:2: error: expected `)'
bug.cc:2: error: expected `,' or `;'
bug.cc:2: error: expected unqualified-id
bug.cc:2: error: expected `,' or `;'

###########################################

This can be further reduced to

/* From /usr/include/float.h */
extern int __fpclassifyf (float x);
extern int __fpclassifyd (double x);
#define fpclassify(x) (__extension__ ({__typeof__(x) __x = (x); \
(sizeof (__x) == sizeof (float)) ? __fpclassifyf(__x) : __fpclassifyd(__x);}))

void fpclassify() { }

#############################################
The preprocessed source becomes

void (__extension__ ({__typeof__() __x = (); (sizeof (__x) == sizeof (float)) ? __fpclassifyf(__x) : __fpclassifyd(__x);})) { }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]