OSDN Git Service

* lib/obj-c++.exp (obj-c++_target_compile): Declare global variable,
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.law / operators27.C
index f8ca9d1..c284a2a 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-do run  }
 // GROUPS passed operators
 // opr-new file
 // From: David Binderman 3841 <dcb@us-es.sel.de>
@@ -11,7 +12,7 @@ int FLAG=0;
 
 extern "C" int printf( const char *, ...);
 
-void * operator new(size_t, const nothrow_t&) throw()         { FLAG=1; return 0; }
+void * operator new(size_t, const std::nothrow_t&) throw()         { FLAG=1; return 0; }
 
 class K {
 private:
@@ -24,9 +25,9 @@ public:
 
 int main(void)
 {
-    K * pK = new (nothrow) K( 10);
+    K * pK = new (std::nothrow) K( 10);
     if ( FLAG != 1 )
-       printf ("FAIL\n");
+       { printf ("FAIL\n"); return 1; }
     else
        printf ("PASS\n");
     return 0;