Debian Codegraph @

clang/test/SemaCXX/invalid-std-initializer-list.cpp

raw
1 // RUN: %clang_cc1 %s -verify -std=c++20
2
3 namespace std {
4
5 template<class T, class = T::x> // expected-error 2 {{type 'int' cannot be used prior to '::' because it has no members}}
6 class initializer_list;
7
8 }
9
10 namespace gh132256 {
11
12 auto x = {1}; // expected-note {{in instantiation of default argument for 'initializer_list<int>' required here}}
13
14 void f() {
15 for(int x : {1, 2}); // expected-note {{in instantiation of default argument for 'initializer_list<int>' required here}}
16 }
17
18 }