File tree 14 files changed +69
-10
lines changed
14 files changed +69
-10
lines changed Original file line number Diff line number Diff line change 1
- #include < assert.h >
1
+ #include < cassert >
2
2
3
3
class my_class
4
4
{
Original file line number Diff line number Diff line change 1
- #include < assert.h >
1
+ #include < cassert >
2
2
3
3
const auto i=1 ;
4
4
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.cpp
3
+ -std=c++11
4
+ ^EXIT=(64|1)$
5
+ ^SIGNAL=0$
6
+ not accessible
7
+ --
8
+ ^warning: ignoring
Original file line number Diff line number Diff line change 1
- #include < assert.h >
1
+ #include < cassert >
2
2
3
3
int main ()
4
4
{
Original file line number Diff line number Diff line change 1
- #include < assert.h >
1
+ #include < cassert >
2
2
3
3
#define COPY
4
4
Original file line number Diff line number Diff line change 1
- #include < assert.h >
1
+ #include < cassert >
2
2
3
3
class myarray {
4
4
Original file line number Diff line number Diff line change 1
- #include < assert.h >
1
+ #include < cassert >
2
2
3
3
#define FUNCTION
4
4
Original file line number Diff line number Diff line change 1
- #include < assert.h >
1
+ #include < cassert >
2
2
3
3
#define CLASS
4
4
Original file line number Diff line number Diff line change 1
- #include < assert.h >
1
+ #include < cassert >
2
2
3
3
int main (int argc, char ** argv)
4
4
{
Original file line number Diff line number Diff line change 1
- #include < assert.h >
1
+ #include < cassert >
2
2
3
3
int main (int argc, char ** argv)
4
4
{
Original file line number Diff line number Diff line change 1
- #include < assert.h >
1
+ #include < cassert >
2
2
3
3
class Foo ;
4
4
Original file line number Diff line number Diff line change @@ -450,6 +450,14 @@ void cpp_typecheckt::typecheck_compound_declarator(
450
450
451
451
if (is_method)
452
452
{
453
+ if (
454
+ value.id () == ID_code &&
455
+ to_code (value).get_statement () == ID_cpp_delete)
456
+ {
457
+ value.make_nil ();
458
+ component.set (ID_access, " noaccess" );
459
+ }
460
+
453
461
component.set (ID_is_inline, declaration.member_spec ().is_inline ());
454
462
455
463
// the 'virtual' name of the function
Original file line number Diff line number Diff line change @@ -2494,13 +2494,25 @@ bool Parser::rConstructorDecl(
2494
2494
2495
2495
case TOK_DEFAULT: // C++0x
2496
2496
{
2497
+ if (!ansi_c_parser.cpp11 )
2498
+ {
2499
+ SyntaxError ();
2500
+ return false ;
2501
+ }
2502
+
2497
2503
constructor.value ()=codet (ID_default);
2498
2504
set_location (constructor.value (), value);
2499
2505
}
2500
2506
break ;
2501
2507
2502
2508
case TOK_DELETE: // C++0x
2503
2509
{
2510
+ if (!ansi_c_parser.cpp11 )
2511
+ {
2512
+ SyntaxError ();
2513
+ return false ;
2514
+ }
2515
+
2504
2516
constructor.value ()=codet (ID_cpp_delete);
2505
2517
set_location (constructor.value (), value);
2506
2518
}
@@ -2675,12 +2687,24 @@ bool Parser::rDeclaratorWithInit(
2675
2687
2676
2688
if (lex.LookAhead (0 )==TOK_DEFAULT) // C++0x
2677
2689
{
2690
+ if (!ansi_c_parser.cpp11 )
2691
+ {
2692
+ SyntaxError ();
2693
+ return false ;
2694
+ }
2695
+
2678
2696
lex.get_token (tk);
2679
2697
declarator.value ()=codet (ID_default);
2680
2698
set_location (declarator.value (), tk);
2681
2699
}
2682
2700
else if (lex.LookAhead (0 )==TOK_DELETE) // C++0x
2683
2701
{
2702
+ if (!ansi_c_parser.cpp11 )
2703
+ {
2704
+ SyntaxError ();
2705
+ return false ;
2706
+ }
2707
+
2684
2708
lex.get_token (tk);
2685
2709
declarator.value ()=codet (ID_cpp_delete);
2686
2710
set_location (declarator.value (), tk);
You can’t perform that action at this time.
0 commit comments