r291319 - PR20090: Add (passing) test from this bug; it's been fixed for a while.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 6 16:52:10 PST 2017


Author: rsmith
Date: Fri Jan  6 18:52:10 2017
New Revision: 291319

URL: http://llvm.org/viewvc/llvm-project?rev=291319&view=rev
Log:
PR20090: Add (passing) test from this bug; it's been fixed for a while.

Modified:
    cfe/trunk/test/SemaTemplate/constexpr-instantiate.cpp

Modified: cfe/trunk/test/SemaTemplate/constexpr-instantiate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/constexpr-instantiate.cpp?rev=291319&r1=291318&r2=291319&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/constexpr-instantiate.cpp (original)
+++ cfe/trunk/test/SemaTemplate/constexpr-instantiate.cpp Fri Jan  6 18:52:10 2017
@@ -252,3 +252,10 @@ namespace NoInstantiationWhenSelectingOv
   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, "");
+}




More information about the cfe-commits mailing list