[clang] [Clang] Do not try to transform invalid bindings (PR #125658)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 10 18:07:53 PST 2025
================
@@ -188,3 +188,19 @@ void other_main() {
static_assert(f<int>() == 2);
}
} // namespace
+
+
+namespace GH125165 {
+
+template <typename = void>
+auto f(auto t) {
+ const auto& [...pack] = t;
+ // expected-error at -1 {{cannot decompose non-class, non-array type 'char const'}}
+ (pack, ...);
+};
+
+void g() {
+ f('x'); // expected-note {{in instantiation}}
----------------
shafik wrote:
Maybe: https://godbolt.org/z/Ejf8Mj5jj
https://github.com/llvm/llvm-project/pull/125658
More information about the cfe-commits
mailing list