From baf8130c47595c5fdc8b3f1333c596b079cb377c Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sat, 7 Jan 2017 00:52:10 +0000 Subject: PR20090: Add (passing) test from this bug; it's been fixed for a while. llvm-svn: 291319 --- clang/test/SemaTemplate/constexpr-instantiate.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/test') diff --git a/clang/test/SemaTemplate/constexpr-instantiate.cpp b/clang/test/SemaTemplate/constexpr-instantiate.cpp index b8cfbe1e0e2..dfb8a07d3b7 100644 --- a/clang/test/SemaTemplate/constexpr-instantiate.cpp +++ b/clang/test/SemaTemplate/constexpr-instantiate.cpp @@ -252,3 +252,10 @@ namespace NoInstantiationWhenSelectingOverload { void h() { (void)sizeof(char{f(0)}); } void i() { (void)sizeof(char{f("oops")}); } // expected-note {{instantiation of}} } + +namespace PR20090 { + template constexpr T fact(T n) { + return n == 0 ? 1 : [=] { return n * fact(n - 1); }(); + } + static_assert(fact(0) == 1, ""); +} -- cgit v1.2.3