From c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 2 Aug 2018 17:33:11 +0000 Subject: Vendor import of clang trunk r338536: https://llvm.org/svn/llvm-project/cfe/trunk@338536 --- .../CodeGenCXX/castexpr-basepathsize-threshold.cpp | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/CodeGenCXX/castexpr-basepathsize-threshold.cpp (limited to 'test/CodeGenCXX/castexpr-basepathsize-threshold.cpp') diff --git a/test/CodeGenCXX/castexpr-basepathsize-threshold.cpp b/test/CodeGenCXX/castexpr-basepathsize-threshold.cpp new file mode 100644 index 000000000000..d5c1f603ff3f --- /dev/null +++ b/test/CodeGenCXX/castexpr-basepathsize-threshold.cpp @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - + +// https://bugs.llvm.org/show_bug.cgi?id=38356 +// We only check that we do not crash. + +template +struct d : d {}; +template +struct d { + a f[0]; +}; +struct g { + static g h(unsigned); +}; +struct i { + void j() const; + // Current maximum depth of recursive template instantiation is 1024, + // thus, this \/ threshold value is used here. BasePathSize in CastExpr might + // not fit it, so we are testing that we do fit it. + // If -ftemplate-depth= is provided, larger values (4096 and up) cause crashes + // elsewhere. + d f; +}; +void i::j() const { + const void *k{f.f}; + (void)k; +} -- cgit v1.3