Skip to content
Snippets Groups Projects
Commit 3f2b9445 authored by an7s's avatar an7s
Browse files

Testing c++

Former-commit-id: ac4a4bbe4c9f413632c7f9b527a72ece95c96b92
parent 35b6b948
Branches
Tags
No related merge requests found
...@@ -301,6 +301,7 @@ libtransform/tests/austin/branch.c -text ...@@ -301,6 +301,7 @@ libtransform/tests/austin/branch.c -text
libtransform/tests/austin/malloc.c -text libtransform/tests/austin/malloc.c -text
libtransform/tests/austin/memcpy.c -text libtransform/tests/austin/memcpy.c -text
libtransform/tests/austin/memset.c -text libtransform/tests/austin/memset.c -text
libtransform/tests/c++/prog.c -text
libtransform/tests/clark1.c -text libtransform/tests/clark1.c -text
libtransform/tests/false_positives/cat.err -text libtransform/tests/false_positives/cat.err -text
libtransform/tests/false_positives/cat.out -text libtransform/tests/false_positives/cat.out -text
......
#include <iostream>
using namespace std;
class A {
public:
A(char *p) { m_string = string(p); }
A(string s) { m_string = s; }
std::string getString() { return m_string; }
~A() { m_string = ""; }
private:
std::string m_string;
};
class B : public A {
public:
B(string s) : A(s) { m_x = 1;} ;
void C() { throw std::exception(); }
protected:
int m_x;
};
main()
{
A a("hello");
std::string world("world");
B b("world");
cerr << a.getString() << endl;
cout << b.getString() << endl;
try {
b.C();
} catch (...)
{
cerr << "exception caught" << endl;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment