diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-11-25 04:08:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-11-25 04:08:05 +0000 |
commit | c83ed049af2a2ed7ab94b8206fc0fec4da7e26db (patch) | |
tree | 4ee8215bece0480dbc5ce31758798c323bf807ee | |
parent | 0fe7bea6fca9737c6c145aaa4a2ad3abe595782a (diff) |
Test another error message, make sure to verify C++ new and delete tests
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60007 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/SemaCXX/new-delete.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/SemaCXX/new-delete.cpp b/test/SemaCXX/new-delete.cpp index 60f77e4ef9..1ff1b2ecb5 100644 --- a/test/SemaCXX/new-delete.cpp +++ b/test/SemaCXX/new-delete.cpp @@ -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 @@ void good_news() 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 bad_news() (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. } |