[clang] [Clang] Initializer list on RHS of assignment (PR #100548)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 25 06:48:34 PDT 2024
================
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+
+template<typename T>
+void f(T dependent) {
+ int i;
+ i = { dependent, dependent };
+}
+
+template<typename T>
+void f2(T dependent) {
+ int i;
+ i = { dependent, dependent }; // expected-error {{excess elements in scalar initializer}}
----------------
cor3ntin wrote:
can you add a test for `i = { dependent }`
https://github.com/llvm/llvm-project/pull/100548
More information about the cfe-commits
mailing list