diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2013-09-14 12:00:01 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2013-09-14 12:00:01 +0000 |
commit | 3225b9c9b35056f15b967bda1f1d8a3ca1680a42 (patch) | |
tree | f3cf05e9e29e4eb6cc54f19f8893a1d27971191b /test/SemaCXX/PR12778.cpp | |
parent | d3d9e0f4a107e97b493e1d4c7c5b5dc15e7e137a (diff) | |
download | clang-3225b9c9b35056f15b967bda1f1d8a3ca1680a42.tar.gz |
Avoid getting an argument of allocation function if it does not exist.
This is a fix to PR12778: in erroneous code an allocation function
can be declared with no arguments, quering the first argument in this case
causes assertion violation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/PR12778.cpp')
-rw-r--r-- | test/SemaCXX/PR12778.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaCXX/PR12778.cpp b/test/SemaCXX/PR12778.cpp new file mode 100644 index 0000000000..f4d25f3e8f --- /dev/null +++ b/test/SemaCXX/PR12778.cpp @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +void operator delete() throw(void*); // expected-error{{'operator delete' must have at least one parameter}} +void* allocate(int __n) { + return ::operator new(__n); +} + |