This section describes unsupported or unimplemented features.
(a=7, b) = 10;
namespace A {
----------^------------------- ERROR
int f(int x);
}
class C {
public:
static int i;
static struct S {
int i; char c;
} s;
};
int C::i = s.i;
enum {one=1, two, hidden_name };
struct hidden_name{int x;};
-----------^----------------Not allowed
int x; int y = x;
void f()
{
union { int x; double y; };
x = 1;
y = 1.0;
}
int myfun (char x){}
int myfun (unsigned char x){}
--------------^--------------------------Illegal function redefinition
enum e { gwiz }; // global enum e
void f()
{
enum e { lwiz };
---------------^---------------- ERROR: Illegal enum redeclaration
}
int myfun(short l) { return 0; }
int myfun(const int l) { return 1; }
enum E { x, y };
myfun(x); /*should be 1*/
enum {two = 2};
struct D { unsigned char : two; };
Class B:public A(){};
Class C: public B(){};
Class D :public B, public A,publicC{};
class A{};
class B: public virtual A{};
class C: public virtual A{};
class D: public B, public C{}
class A{
public:
static int b;
int f(){return b;};
};
int A::b = 1;
int x = f(); /*ERROR : x!=1 (it should be 1)*/
class A{
static int f(){return 0;}
friend void call_f(){
f();
------^-----ERROR: missing prototype (it should be accepted by the compiler)
}
}
#define MACRO (X) 1+ X MACRO(1) + 1; -------------^-------------------Illegal cast-operation
#line 19 "testfile.C" //line directive should alter __FILE__
power(FLT_RADIX, FLT_MIN_EXP -1) != FLT_MIN
FLT_MAX / FLT_RADIX + power(FLT_RADIX, FLT_MAX_EXP-FLT_MANT_DIG-1)!= power(FLT_RADIX,FLT_MAX_EXP-1)
int f ( short , int ) { return 1; }
template <class T> int f(char, T) { return 2; }
value = f(1, 2);
---------^----------------------ERROR: Ambiguous
const X& r = 4; -----------------------^------------ERROR: Illegal cast-operation
int a7, a; if(&(::a7) == &a); ---------^-------------------ERROR:Not supported operator ::
class complex{
float re, im;
complex(float r, float i = 0) { re=r; im=i; };
int operator!=( complex x ){}
}
complex z = 1;
z!=1
---------^------------ERROR :Type mismatch
class A {
public:
int a;
A(int);
};
class B: public A{
public:
int b;
B(int, int);>
};
B::B(int c, int d) : A(d) { b = c; }
B b_obj(1, 2);
int x = B_obj.a;
-----^----------ERROR: x should be 2
typedef int new_type; typedef int new_type; --------------^-------ERROR: Invalid redeclaration of new_type
return ((void) 1); ----------------------------^------------ERROR
void f() {}
int i[sizeof &f];
--------------------^-------------ERROR
int i = 4;
int main(){
if ((i != 1) || (::i != 4));
------------------------^----------ERROR
}
argv[argc]!=0 (it should be guaranteed that argv[argc]==0.)
int main(){
int f(void);
int (&fr)(void) = f;/
}
class X {
public:
X *f() { return this; }
};
int type(void *x) {return VOIDP;}
int type(X *x) {return CXP;}
X x;
type(x.f())
-----^--------ERROR: ambiguous
struct S {
S(){}
int f() { return 0; }
int g() { return 11; }
int h() {
return (this->*((0?(&S::f) : (&S::g))))();
------------------------------^-------------ERROR
}
};
enum E { i=INT_MAX, ui=UINT_MAX , l=LONG_MAX, ul=ULONG_MAX };
-------------------------^--------------ERROR: Integral type expected or enum value out of range
struct S{
S() {}
~S () {destruct_counter++;}
void * operator new (size_t size) {
return new char[size];
}
void operator delete (void * p) {
delete_counter ++;
::delete p;}
};
S * ps = new S[3];
delete [] ps;
-------------^--------ERROR: Used delete operator (should use global ::delete)
S * ps1 = new S[5]; ::delete [] ps1; ------------^------ERROR: ~S is not used
void operator delete[](void *p){};
-----------------------^--------------ERROR
- void * operator new[](size_t); -------------------^--------ERROR: Operator must be a function
int *p = new int(1+(2*4)-3); -----------------^-----ERROR: The object is not initialized
int * p1, *p2; p1 = new int; p2 = new (p1) int; --------------^----------------ERROR: Too many arguments
int tab[2][3]; int myfun(int (*tab)[3]); -------------------^---------------------ERROR
label: int x = 0; --------------^---------------ERROR: x not declared (or typename)
int (*fun1(int))(int a) {}
int fun2(int (*fun1(int))(int))()
-----^-------------------------ERROR
typedef int fun(int) -------------------------^-----ERROR
class C {
const int fun1(short);
volatile int fun2(long);
const volatile int fun3(signed);
};
const int (C::*cp1)(short);
-------------^--------------- ERROR:Should be initialized
volatile int (C::*cp2)(long);
-------------^--------------- ERROR: Should be initialized
const volatile int (C::*cp3)(signed);
------------------------^---- ERROR: Should be initialized
struct S {
const int fun1(void);
volatile int fun2(void);
const volatile int fun3(void);
} s;
const int (S::*sp1)(void) = &S::fun1;
if(!sp1);
--------^----------------------------ERROR:Expected int
int f(int i, char c) {return 1;}
f('abcd', 'c');
-----------^--------------------ERROR
int type(const char a[]){return 1};
type("five") != 1 /*Runtime failed*/
struct S {
int i;
S(int b){ i = b;}
};
S x(int(a));
--------^----------ERROR: Should have been a function declaration, not an object declaration
int i; typedef int& c; const c cref = i;// reference to int --------------------^------------------ERROR
switch(val)
{
case 0:
int a = 10; // invalid, warning should be reported
break;
case 1:
int b; // valid
b = 11;
break;
case 2:
break;
}