================
@@ -1943,6 +1943,10 @@ namespace InitializerList {
     constexpr std::initializer_list<float> il = {1.0, 2.0, 3.0};
     static_assert(il.begin()[1] == 2.0, "");
   }
+
+  void constexpr_loop_var() {
+    for (constexpr auto x : {1, 2, 3}) {} // expected-error {{constexpr 
variable 'x' must be initialized by a constant expression}} expected-note 
{{iterator of the range-based for loop is not a constant expression}}
+  }
----------------
akash-manna-sky wrote:

I added, right below. 

https://github.com/llvm/llvm-project/pull/218145
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to