Skip to content

Commit b3f03f9

Browse files
committed
C++ front-end: support =delete method declarations
This enables us to use use cassert instead of assert.h in C++ regression tests, as Visual Studio's header files make use of this.
1 parent a68c9c3 commit b3f03f9

File tree

11 files changed

+19
-10
lines changed

11 files changed

+19
-10
lines changed

regression/cpp/Method_qualifier1/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <assert.h>
1+
#include <cassert>
22

33
class my_class
44
{

regression/cpp/auto1/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <assert.h>
1+
#include <cassert>
22

33
const auto i=1;
44

regression/cpp/switch1/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <assert.h>
1+
#include <cassert>
22

33
int main()
44
{

regression/systemc/Array1/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <assert.h>
1+
#include <cassert>
22

33
#define COPY
44

regression/systemc/Array2/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <assert.h>
1+
#include <cassert>
22

33
class myarray {
44

regression/systemc/Array3/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <assert.h>
1+
#include <cassert>
22

33
#define FUNCTION
44

regression/systemc/Array4/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <assert.h>
1+
#include <cassert>
22

33
#define CLASS
44

regression/systemc/BitvectorCpp1/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <assert.h>
1+
#include <cassert>
22

33
int main(int argc, char** argv)
44
{

regression/systemc/BitvectorCpp2/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <assert.h>
1+
#include <cassert>
22

33
int main(int argc, char** argv)
44
{

regression/systemc/This1/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <assert.h>
1+
#include <cassert>
22

33
class Foo;
44

src/cpp/cpp_typecheck_compound_type.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,15 @@ void cpp_typecheckt::typecheck_compound_declarator(
434434

435435
if(is_method)
436436
{
437+
// test for decl(...) = delete; -- make it non-existent by not converting
438+
// the declaration
439+
if(
440+
value.id() == ID_code &&
441+
to_code(value).get_statement() == ID_cpp_delete)
442+
{
443+
return;
444+
}
445+
437446
component.set(ID_is_inline, declaration.member_spec().is_inline());
438447

439448
// the 'virtual' name of the function

0 commit comments

Comments
 (0)