@@ -149,7 +149,8 @@ namespace PR12031 {
149
149
void f (int i, X x);
150
150
void g () {
151
151
const int v = 10 ;
152
- f (v, [](){});
152
+ f (v, [](){}); // cxx03-warning {{template argument uses local type}} \
153
+ // cxx03-note {{while substituting}}
153
154
}
154
155
}
155
156
@@ -572,26 +573,37 @@ namespace PR27994 {
572
573
struct A { template <class T > A (T); };
573
574
574
575
template <class T >
575
- struct B {
576
+ struct B { // #PR27994_B
576
577
int x;
577
- A a = [&] { int y = x; };
578
- A b = [&] { [&] { [&] { int y = x; }; }; };
579
- A d = [&](auto param) { int y = x; }; // cxx03-cxx11-error {{'auto' not allowed in lambda parameter}}
580
- A e = [&](auto param) { [&] { [&](auto param2) { int y = x; }; }; }; // cxx03-cxx11-error 2 {{'auto' not allowed in lambda parameter}}
578
+ A a = [&] { int y = x; }; // cxx03-warning {{template argument uses unnamed type}} \
579
+ // cxx03-note {{while substituting}} cxx03-note {{unnamed type used}}
580
+ A b = [&] { [&] { [&] { int y = x; }; }; }; // cxx03-warning {{template argument uses unnamed type}} \
581
+ // cxx03-note {{while substituting}} cxx03-note {{unnamed type used}}
582
+ A d = [&](auto param) { int y = x; }; // cxx03-cxx11-error {{'auto' not allowed in lambda parameter}} \
583
+ // cxx03-warning {{template argument uses unnamed type}} \
584
+ // cxx03-note {{while substituting}} cxx03-note {{unnamed type used}}
585
+ A e = [&](auto param) { [&] { [&](auto param2) { int y = x; }; }; }; // cxx03-cxx11-error 2 {{'auto' not allowed in lambda parameter}} \
586
+ // cxx03-warning {{template argument uses unnamed type}} \
587
+ // cxx03-note {{while substituting}} cxx03-note {{unnamed type used}}
581
588
};
582
589
583
590
B<int > b;
591
+ // cxx03-note@#PR27994_B 4{{in instantiation of default member initializer}}
592
+ // cxx03-note@-2 4{{in evaluation of exception}}
584
593
585
594
template <class T > struct C {
586
595
struct D {
596
+ // cxx03-note@-1 {{in instantiation of default member initializer}}
587
597
int x;
588
- A f = [&] { int y = x; };
598
+ A f = [&] { int y = x; }; // cxx03-warning {{template argument uses unnamed type}} \
599
+ // cxx03-note {{while substituting}} cxx03-note {{unnamed type used}}
589
600
};
590
601
};
591
602
592
603
int func () {
593
604
C<int > a;
594
605
decltype (a)::D b;
606
+ // cxx03-note@-1 {{in evaluation of exception}}
595
607
}
596
608
}
597
609
@@ -606,8 +618,12 @@ struct S1 {
606
618
607
619
void foo1 () {
608
620
auto s0 = S1 ([name=]() {}); // expected-error {{expected expression}}
621
+ // cxx03-warning@-1 {{template argument uses local type}} \
622
+ // cxx03-note@-1 {{while substituting deduced template arguments}}
609
623
auto s1 = S1 ([name=name]() {}); // expected-error {{use of undeclared identifier 'name'; did you mean 'name1'?}}
610
624
// cxx03-cxx11-warning@-1 {{initialized lambda captures are a C++14 extension}}
625
+ // cxx03-warning@-2 {{template argument uses local type}} \
626
+ // cxx03-note@-2 {{while substituting deduced template arguments}}
611
627
}
612
628
}
613
629
0 commit comments