[clang] e778db6 - recommit b58f6bb1207521cdf6a856004525d7bffa5f2153

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 18 21:28:26 PDT 2020


Author: Yaxun (Sam) Liu
Date: 2020-03-19T00:26:38-04:00
New Revision: e778db6d7217d5e9d2c2a25467a46147f521160d

URL: https://github.com/llvm/llvm-project/commit/e778db6d7217d5e9d2c2a25467a46147f521160d
DIFF: https://github.com/llvm/llvm-project/commit/e778db6d7217d5e9d2c2a25467a46147f521160d.diff

LOG: recommit b58f6bb1207521cdf6a856004525d7bffa5f2153

Add a test for UsedDeclVisitor

This test is reduced from mlir/lib/Transforms/AffineDataCopyGeneration.cpp
to make sure there is no assertion due to UsedDeclVisitor.

Added: 
    clang/test/CodeGenCXX/used-decl-visitor.cpp

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGenCXX/used-decl-visitor.cpp b/clang/test/CodeGenCXX/used-decl-visitor.cpp
new file mode 100644
index 000000000000..2b923ab562db
--- /dev/null
+++ b/clang/test/CodeGenCXX/used-decl-visitor.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -triple x86_64 -emit-llvm -o %t %s
+
+// Make sure there is no assertion due to UsedDeclVisitor.
+
+struct A {
+  int a;
+};
+
+static A a;
+
+struct B {
+  B(int b = a.a) {}
+};
+
+
+void foo() {
+  B();
+}


        


More information about the cfe-commits mailing list