diff options
Diffstat (limited to 'test/ASTMerge/Inputs')
-rw-r--r-- | test/ASTMerge/Inputs/anonymous-fields1.cpp | 5 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/anonymous-fields2.cpp | 9 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/class1.cpp | 3 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/class2.cpp | 3 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/inheritance-base.cpp | 7 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/init-ctors-classes.cpp | 19 |
6 files changed, 44 insertions, 2 deletions
diff --git a/test/ASTMerge/Inputs/anonymous-fields1.cpp b/test/ASTMerge/Inputs/anonymous-fields1.cpp new file mode 100644 index 0000000000000..829bc0edd30a6 --- /dev/null +++ b/test/ASTMerge/Inputs/anonymous-fields1.cpp @@ -0,0 +1,5 @@ +class A { +public: + struct { int foo; } f; + struct { int foo; } g; +}; diff --git a/test/ASTMerge/Inputs/anonymous-fields2.cpp b/test/ASTMerge/Inputs/anonymous-fields2.cpp new file mode 100644 index 0000000000000..28ea46d98711b --- /dev/null +++ b/test/ASTMerge/Inputs/anonymous-fields2.cpp @@ -0,0 +1,9 @@ +class A { +public: + struct { int foo; } f; + struct { int foo; } g; +}; + +inline int useA(A &a) { + return (a.f.foo + a.g.foo); +} diff --git a/test/ASTMerge/Inputs/class1.cpp b/test/ASTMerge/Inputs/class1.cpp index 0cd6565f1a928..b0a7645cfe630 100644 --- a/test/ASTMerge/Inputs/class1.cpp +++ b/test/ASTMerge/Inputs/class1.cpp @@ -1,5 +1,6 @@ struct A { - int x; + public: + int x; }; struct B : A { diff --git a/test/ASTMerge/Inputs/class2.cpp b/test/ASTMerge/Inputs/class2.cpp index 5d5d9ca2333cb..2bed6d775bc46 100644 --- a/test/ASTMerge/Inputs/class2.cpp +++ b/test/ASTMerge/Inputs/class2.cpp @@ -1,5 +1,6 @@ struct A { - int x; + public: + int x; }; struct B : A { diff --git a/test/ASTMerge/Inputs/inheritance-base.cpp b/test/ASTMerge/Inputs/inheritance-base.cpp new file mode 100644 index 0000000000000..26fe42eb64da3 --- /dev/null +++ b/test/ASTMerge/Inputs/inheritance-base.cpp @@ -0,0 +1,7 @@ +class A +{ +public: + int x; + A(int _x) : x(_x) { + } +}; diff --git a/test/ASTMerge/Inputs/init-ctors-classes.cpp b/test/ASTMerge/Inputs/init-ctors-classes.cpp new file mode 100644 index 0000000000000..fd51f860634b5 --- /dev/null +++ b/test/ASTMerge/Inputs/init-ctors-classes.cpp @@ -0,0 +1,19 @@ +class A_base +{ +public: + int x; + A_base() : x(0) { + } + A_base(int _x) : x(static_cast<int>(_x)) { + } +}; + +class A : public A_base +{ +public: + int y; + struct { int z; }; + int array[2]; + A(int _x) : A_base(_x), y(0), z(1), array{{2},{3}} { + } +}; |