summaryrefslogtreecommitdiffstats
path: root/clang/test/ASTMerge/Inputs/inheritance-base.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2016-05-14 05:43:57 +0000
committerSean Callanan <scallanan@apple.com>2016-05-14 05:43:57 +0000
commit041cceb019cf906a9caa1e485bec0843530cff6a (patch)
tree89ec9ca959867313b488c3435982ec2bba6d2c92 /clang/test/ASTMerge/Inputs/inheritance-base.cpp
parenta3cd590644305727bc54fd63334b1ce0a0401999 (diff)
downloadbcm5719-llvm-041cceb019cf906a9caa1e485bec0843530cff6a.tar.gz
bcm5719-llvm-041cceb019cf906a9caa1e485bec0843530cff6a.zip
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
Diffstat (limited to 'clang/test/ASTMerge/Inputs/inheritance-base.cpp')
-rw-r--r--clang/test/ASTMerge/Inputs/inheritance-base.cpp7
1 files changed, 7 insertions, 0 deletions
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) {
+ }
+};
OpenPOWER on IntegriCloud