I have got an error message with next code
template< typename Type > int func( Type as, float fl=NAN );
error: #109: expression preceding parentheses of apparent call must have (pointer-to-) function type
It seems the problem is with resolving NAN, defined in math.h at line 249
# define NAN (__ESCAPE__(0f_7FC00000))
There is no problem if no NAN used
template< typename Type > int func( Type as, float fl=0 );
There is no problem if template not used
int func( int as, float fl=NAN );
There is no problem with GCC.
Compilier version
*** Using Compiler 'V5.05 update 2 (build 169)'
Yet another...
#include <cmath> class Cla { float h = NAN; // error: #65: expected a ";" };
What's the f... The medicine is same
#include <cmath> #ifdef __CC_ARM // ARM CC bug http://www.keil.com/forum/60227/ #define __ESCAPE__(__x) (__x) #endif
All files compiled with --cpp11.