summaryrefslogtreecommitdiffstats
path: root/clang/test/ASTMerge
diff options
context:
space:
mode:
authorBalazs Keri <1.int32@gmail.com>2018-08-08 09:40:57 +0000
committerBalazs Keri <1.int32@gmail.com>2018-08-08 09:40:57 +0000
commit2544b4b00ac05cf2e80cd4c7a75277dd930ec80d (patch)
tree293582c97c10b3a24c6221b40d02457f0870f77f /clang/test/ASTMerge
parent4107b31df25af1d5ff65607e83686ec4188b7349 (diff)
downloadbcm5719-llvm-2544b4b00ac05cf2e80cd4c7a75277dd930ec80d.tar.gz
bcm5719-llvm-2544b4b00ac05cf2e80cd4c7a75277dd930ec80d.zip
[ASTImporter] Load external Decls when getting field index.
Summary: At equality check of fields without name the index of fields is compared. At determining the index of a field all fields of the parent context should be loaded from external source to find the field at all. Reviewers: a.sidorin, a_sidorin, r.stahl Reviewed By: a.sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D49796 llvm-svn: 339226
Diffstat (limited to 'clang/test/ASTMerge')
-rw-r--r--clang/test/ASTMerge/unnamed_fields/Inputs/il.cpp3
-rw-r--r--clang/test/ASTMerge/unnamed_fields/test.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/ASTMerge/unnamed_fields/Inputs/il.cpp b/clang/test/ASTMerge/unnamed_fields/Inputs/il.cpp
new file mode 100644
index 00000000000..1bb0f358dcf
--- /dev/null
+++ b/clang/test/ASTMerge/unnamed_fields/Inputs/il.cpp
@@ -0,0 +1,3 @@
+void f(int X, int Y, bool Z) {
+ auto x = [X, Y, Z] { (void)Z; };
+}
diff --git a/clang/test/ASTMerge/unnamed_fields/test.cpp b/clang/test/ASTMerge/unnamed_fields/test.cpp
new file mode 100644
index 00000000000..6ae3176df4f
--- /dev/null
+++ b/clang/test/ASTMerge/unnamed_fields/test.cpp
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/il.cpp
+// RUN: %clang_cc1 -ast-merge %t.1.ast -fsyntax-only %s 2>&1 | FileCheck --allow-empty %s
+// CHECK-NOT: warning: field '' declared with incompatible types in different translation units ('bool' vs. 'int')
OpenPOWER on IntegriCloud