[cfe-commits] r60007 - /cfe/trunk/test/SemaCXX/new-delete.cpp

Douglas Gregor doug.gregor at gmail.com
Mon Nov 24 20:08:05 PST 2008


Author: dgregor
Date: Mon Nov 24 22:08:05 2008
New Revision: 60007

URL: http://llvm.org/viewvc/llvm-project?rev=60007&view=rev
Log:
Test another error message, make sure to verify C++ new and delete tests

Modified:
    cfe/trunk/test/SemaCXX/new-delete.cpp

Modified: cfe/trunk/test/SemaCXX/new-delete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/new-delete.cpp?rev=60007&r1=60006&r2=60007&view=diff

==============================================================================
--- cfe/trunk/test/SemaCXX/new-delete.cpp (original)
+++ cfe/trunk/test/SemaCXX/new-delete.cpp Mon Nov 24 22:08:05 2008
@@ -1,3 +1,5 @@
+// RUN: clang -fsyntax-only -verify %s
+
 struct S // expected-note {{candidate}}
 {
   S(int, int, double); // expected-note {{candidate}}
@@ -21,7 +23,7 @@
   ia4 *pai = new (int[3][4]);
 }
 
-void bad_news()
+void bad_news(int *ip)
 {
   int i = 1;
   (void)new; // expected-error {{missing type specifier}}
@@ -33,9 +35,9 @@
   (void)new int(*(S*)0); // expected-error {{incompatible type initializing}}
   (void)new int(1, 2); // expected-error {{initializer of a builtin type can only take one argument}}
   (void)new S(1); // expected-error {{no matching constructor}}
-  (void)new S(1, 1); // expected-error {{call to constructor of 'struct S' is ambiguous}}
+  (void)new S(1, 1); // expected-error {{call to constructor of 'S' is ambiguous}}
   (void)new const int; // expected-error {{must provide an initializer}}
-  
+  (void)new float*(ip); // expected-error {{incompatible type initializing 'int *', expected 'float *'}}
   // Some lacking cases due to lack of sema support.
 }
 





More information about the cfe-commits mailing list