I’ve been having a problem compiling octave and this is a simple example of what I’m running into. Is the following valid C++ and there’s a compiler error, or does it not conform to the standard? If the latter can you point to to a chapter/verse?
[chulbert@hulbert64 ~]$ pgCC -Minform=inform test2.cc
“test2.cc”, line 10: error: a storage class may not be specified here
static inline void a (int &x)
^
1 error detected in the compilation of “test2.cc”.
[chulbert@hulbert64 ~]$ g++ -Wall -pedantic test2.cc
[chulbert@hulbert64 ~]$ cat test2.cc
#include <stdlib.h>
template
static inline void a (T &x)
{
x=x+1;
}
template <>
static inline void a (int &x)
{
x=x+1;
}
int main(void)
{
int y = -1;
a(y);
return y;
}
[chulbert@hulbert64 ~]$