static int class0_member_1 = 99; /* ERROR - */
int &class0_member_2 = global_int; /* ERROR - */
- class0 () : class0_member_2 (global_int) { }
+ class0 () : class0_member_2 (global_int) { } /* ERROR - */
};
static int struct0_member_1 = 99; /* ERROR - */
int &struct0_member_2 = global_int; /* ERROR - */
- struct0 () : struct0_member_2 (global_int) { }
+ struct0 () : struct0_member_2 (global_int) { } /* ERROR - */
};
// g++ does not allow unions to have more than one member with an initializer
union union2 {
int &union2_member_0 = global_int; /* ERROR - */
- union2 () : union2_member_0 (global_int) { }
+ union2 () : union2_member_0 (global_int) { } /* ERROR - */
};
int main () { return 0; }
}
catch (E *&e) {
- printf ("address of e is 0x%x\n", (long)e);
+ printf ("address of e is 0x%lx\n", (long)e);
return !(long(e) != 5 && e->x == 5);
}
return 2;
class foo {
private:
- const unsigned char * const dummy_key = (unsigned char*)"ThisIs a dummy!";
+ static const unsigned char * const dummy_key = (unsigned char*)"ThisIs a dummy!";
+
public:
void bar ();
};
+++ /dev/null
-// Bug: g++ crashes on this (admittedly invalid) input.
-// Special g++ Options:
-// Build don't link:
-
-class PhysicalPageId {
- const int maximum_block_numbers = 2;
- long block_number[maximum_block_numbers];
-};
-
-const PhysicalPageId shadows_physical_page_id_null = { 2, { 0, 0 } }; // ERROR - constructor initializes non-field m_b_n
struct Crctr
{
+ Crctr() : goop(fighter) {}
+
char dm[24], campaign[24], name[24], player[24];
- goopes goop = fighter;// ERROR - .*
+ goopes goop;
alignments alignment;
int level, maxhit, hitpoints, ac;
abitities scores;// ERROR - .*
class conatiner {
public:
virtual void* first ();
- virtual data* contents (void* i);
+ virtual data* contents (void* i); // ERROR - candidates
};
class user {
data* user::data1() const {
return (_c.contents (_c.first)); // ERROR -
-}
+} // ERROR - control reaches end
--- /dev/null
+// Build don't link:
+
+class X {
+public:
+ const operator int (); // ERROR - invalid declaration.
+};
--- /dev/null
+// Build don't link:
+
+struct X
+{
+ static const bool is_signed = true ;
+ static const int digits = is_signed ? 8 *sizeof(wchar_t)-1 : 0;
+};
--- /dev/null
+// Build don't link:
+
+class error {
+public:
+ error(int) {}
+};
+
+class foo {
+ const error x = 1; // ERROR - initialization of non-static data member
+};
+
+
--- /dev/null
+// Build don't link:
+
+class x
+{
+public:
+ virtual int is_constant();
+};
+
+void foo()
+{
+ x* y;
+ if (y->is_constant) // ERROR - assuming &
+ {
+ }
+}
--- /dev/null
+template <class T>
+void f(T t, int i = 10);
+
+template <class T>
+void f(T t, int i) {}
+
+int main()
+{
+ f(3);
+}
--- /dev/null
+// Build don't link:
+
+template <class T1,class T2>
+struct X
+{
+ T1 a;
+
+ struct Y
+ {
+ T2 x;
+ Y (T2 _x) { x=_x; }
+ };
+
+};
+
+template <class T1>
+struct X<T1,int>
+{
+ T1 a;
+
+ struct Y
+ {
+ int x;
+ Y (int _x) { x=_x; }
+ };
+
+};
+
+template <>
+struct X<int,int>
+{
+ int a;
+
+ struct Y
+ {
+ int x;
+ Y (int _x) { x=_x; }
+ };
+
+};
+
+void f ()
+{
+ X<char,char> t1;
+ X<char,int> t2;
+ X<int,int> t3;
+}