diff options
author | Sean Callanan <scallanan@apple.com> | 2016-05-16 20:48:03 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2016-05-16 20:48:03 +0000 |
commit | 1a1d9f226067a9eca123dd5346cef7d4ccd69679 (patch) | |
tree | 3860f84a6b8b9ff240248a6398cd1ce7a6a6ad7d /test/ASTMerge | |
parent | bd4a20bc9c477ee19112ea4d9440d0823bfa38b1 (diff) |
Added support to the ASTImporter for C++ constructor initializers.
Also added named casts and propagation of "implicit" to fix the LLDB testsuite.
This is a fixed commit of r269546, which was reverted by r269575.
Thanks to Aleksei Sidorin for review and advice.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ASTMerge')
-rw-r--r-- | test/ASTMerge/Inputs/init-ctors-classes.cpp | 19 | ||||
-rw-r--r-- | test/ASTMerge/init-ctors.cpp | 10 |
2 files changed, 29 insertions, 0 deletions
diff --git a/test/ASTMerge/Inputs/init-ctors-classes.cpp b/test/ASTMerge/Inputs/init-ctors-classes.cpp new file mode 100644 index 0000000000..fd51f86063 --- /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}} { + } +}; diff --git a/test/ASTMerge/init-ctors.cpp b/test/ASTMerge/init-ctors.cpp new file mode 100644 index 0000000000..5f0ba4decd --- /dev/null +++ b/test/ASTMerge/init-ctors.cpp @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -emit-pch -o %t.1.ast %S/Inputs/init-ctors-classes.cpp +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -ast-merge %t.1.ast -fsyntax-only -verify %s +// expected-no-diagnostics + +class B { + int method_1() { + A a(0); + return a.x; + } +}; |