From 041cceb019cf906a9caa1e485bec0843530cff6a Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Sat, 14 May 2016 05:43:57 +0000 Subject: Handle injected class names in the ASTImporter. Every class as parsed by Clang has a forward declaration of itself as a member: class A { class A; ... } but when the parser generates this it ensures that the RecordTypes for the two are the same. This makes (among other things) inheritance work. This patch fixes a bug where the ASTImporter generated two separate RecordTypes when importing the class and the contained forward declaration, and adds a test case. Thanks to Doug Gregor for advice on this. llvm-svn: 269551 --- clang/test/ASTMerge/Inputs/inheritance-base.cpp | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 clang/test/ASTMerge/Inputs/inheritance-base.cpp (limited to 'clang/test/ASTMerge/Inputs/inheritance-base.cpp') diff --git a/clang/test/ASTMerge/Inputs/inheritance-base.cpp b/clang/test/ASTMerge/Inputs/inheritance-base.cpp new file mode 100644 index 00000000000..26fe42eb64d --- /dev/null +++ b/clang/test/ASTMerge/Inputs/inheritance-base.cpp @@ -0,0 +1,7 @@ +class A +{ +public: + int x; + A(int _x) : x(_x) { + } +}; -- cgit v1.2.3