[CodeGenPrepare] Drop nsw flags in `optimizeLoadExt` (#118180)
[llvm-project.git] / clang / test / SemaCXX / attribute-pack-expansion.cpp
bloba339e68c09648651d1a13e62b7f32dba0a252744
1 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
3 template <bool... vals>
4 void f() __attribute((diagnose_if(vals, "message", "error"))) { // expected-error {{expression contains unexpanded parameter pack 'vals'}}
5 [] () __attribute((diagnose_if(vals, "message", "error"))) {}(); // expected-error {{expression contains unexpanded parameter pack 'vals'}}
6 [] () __attribute((diagnose_if(vals..., "message", "error"))) {}(); // expected-error {{attribute 'diagnose_if' does not support argument pack expansion}}
7 [] <bool ...inner> () __attribute((diagnose_if(inner, "message", "error"))) {}(); // expected-error {{expression contains unexpanded parameter pack 'inner'}}
8 ([] <bool ...inner> () __attribute((diagnose_if(inner, "message", "error"))) {}(), ...); // expected-error {{expression contains unexpanded parameter pack 'inner'}} \
9 // expected-error {{pack expansion does not contain any unexpanded parameter packs}}
11 // This is fine, so check that we're actually emitting an error
12 // due to the 'diagnose_if'.
13 ([] () __attribute((diagnose_if(vals, "foobar", "error"))) {}(), ...); // expected-error {{foobar}} expected-note {{from 'diagnose_if'}}
16 void g() {
17 f<>();
18 f<false>();
19 f<true, true>(); // expected-note {{in instantiation of}}