diff options
| author | Alexis Hunt <alercah@gmail.com> | 2011-05-06 20:44:56 +0000 |
|---|---|---|
| committer | Alexis Hunt <alercah@gmail.com> | 2011-05-06 20:44:56 +0000 |
| commit | 4a8ea1092abe14eb8e837e2a080b74c958213cd4 (patch) | |
| tree | fa15f407674a846c0f26a4036b6836c441fc78b9 /clang/test/SemaCXX/deleted-function.cpp | |
| parent | 2518f8376d7dcaa28e17c96a34bdd9e0f389cd11 (diff) | |
| download | bcm5719-llvm-4a8ea1092abe14eb8e837e2a080b74c958213cd4.tar.gz bcm5719-llvm-4a8ea1092abe14eb8e837e2a080b74c958213cd4.zip | |
Modify some deleted function methods to better reflect reality:
- New isDefined() function checks for deletedness
- isThisDeclarationADefinition checks for deletedness
- New doesThisDeclarationHaveABody() does what
isThisDeclarationADefinition() used to do
- The IsDeleted bit is not propagated across redeclarations
- isDeleted() now checks the canoncial declaration
- New isDeletedAsWritten() does what it says on the tin.
- isUserProvided() now correct (thanks Richard!)
This fixes the bug that we weren't catching
void foo() = delete;
void foo() {}
as being a redefinition.
llvm-svn: 131013
Diffstat (limited to 'clang/test/SemaCXX/deleted-function.cpp')
| -rw-r--r-- | clang/test/SemaCXX/deleted-function.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/deleted-function.cpp b/clang/test/SemaCXX/deleted-function.cpp index b3e12960042..6a8965ceb57 100644 --- a/clang/test/SemaCXX/deleted-function.cpp +++ b/clang/test/SemaCXX/deleted-function.cpp @@ -7,9 +7,8 @@ void fn() = delete; // expected-note {{candidate function has been explicitly de void fn2(); // expected-note {{previous declaration is here}} void fn2() = delete; // expected-error {{deleted definition must be first declaration}} -void fn3() = delete; -void fn3() { - // FIXME: This definition should be invalid. +void fn3() = delete; // expected-note {{previous definition is here}} +void fn3() { // expected-error {{redefinition}} } void ov(int) {} // expected-note {{candidate function}} |

