diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-07 00:52:10 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-07 00:52:10 +0000 |
| commit | baf8130c47595c5fdc8b3f1333c596b079cb377c (patch) | |
| tree | d19cde94609be889a96ebe10da512ae9070ed2b7 /clang/test | |
| parent | d6a150829b04a63bdcc9bafe4fb7faa0e96a9df5 (diff) | |
| download | bcm5719-llvm-baf8130c47595c5fdc8b3f1333c596b079cb377c.tar.gz bcm5719-llvm-baf8130c47595c5fdc8b3f1333c596b079cb377c.zip | |
PR20090: Add (passing) test from this bug; it's been fixed for a while.
llvm-svn: 291319
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaTemplate/constexpr-instantiate.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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 <typename T> constexpr T fact(T n) { + return n == 0 ? 1 : [=] { return n * fact(n - 1); }(); + } + static_assert(fact(0) == 1, ""); +} |

