diff options
Diffstat (limited to 'clang/test/SemaCXX/new-delete.cpp')
-rw-r--r-- | clang/test/SemaCXX/new-delete.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/test/SemaCXX/new-delete.cpp b/clang/test/SemaCXX/new-delete.cpp index dd28413855b..8a3ec8b16a2 100644 --- a/clang/test/SemaCXX/new-delete.cpp +++ b/clang/test/SemaCXX/new-delete.cpp @@ -140,10 +140,8 @@ public: class Base { public: - static int operator new(signed char) throw(); // expected-error {{'operator new' takes type size_t}} \ - // expected-error {{operator new' must return type 'void *'}} - static int operator new[] (signed char) throw(); // expected-error {{'operator new[]' takes type size_t}} \ - // expected-error {{operator new[]' must return type 'void *'}} + static void *operator new(signed char) throw(); // expected-error {{'operator new' takes type size_t}} + static int operator new[] (size_t) throw(); // expected-error {{operator new[]' must return type 'void *'}} }; class Tier {}; @@ -160,9 +158,11 @@ void loadEngineFor() { } template <class T> struct TBase { - void* operator new(T size, int); // expected-error {{'operator new' takes type size_t}} + void* operator new(T size, int); // expected-error {{'operator new' cannot take a dependent type as first parameter; use size_t}}\ + // expected-error {{'operator new' takes type size_t}} }; +// FIXME: We should not try to instantiate operator new, since it is invalid. TBase<int> t1; // expected-note {{in instantiation of template class 'struct TBase<int>' requested here}} class X6 { |