Skip to content

Commit 834707f

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. =delete and =default are C++11 (and later) only, make sure the parser is sufficiently restrictive.
1 parent 44790d4 commit 834707f

File tree

14 files changed

+69
-10
lines changed

14 files changed

+69
-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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class A
2+
{
3+
public:
4+
void foo() {}
5+
};
6+
7+
class B : public A
8+
{
9+
public:
10+
void foo() = delete;
11+
};
12+
13+
int main()
14+
{
15+
B b;
16+
b.foo();
17+
18+
return 0;
19+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.cpp
3+
-std=c++11
4+
^EXIT=(64|1)$
5+
^SIGNAL=0$
6+
not accessible
7+
--
8+
^warning: ignoring

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
{

0 commit comments

Comments
 (0)