1// RUN: %clang_cc1 -fobjc-runtime=gcc -frecovery-ast -verify %s
2
3@interface Ivar
4{
5  int Foo : foo(); // expected-error {{use of undeclared identifier}}
6};
7@end
8
9struct X { int Y: foo(); }; // expected-error {{use of undeclared identifier}}
10
11constexpr int s = sizeof(Ivar);
12constexpr int ss = sizeof(X);
13
14auto func() {
15  return undef(); // expected-error {{use of undeclared identifier}}
16}
17struct Y {
18  int X : func();
19};
20constexpr int sss = sizeof(Y);
21
22bool Foo(int *); // expected-note {{candidate function not viable}}
23template <typename T>
24struct Base {};
25template <typename T>
26auto func() {
27  // error-bit should be propagated from TemplateArgument to NestNameSpecifier.
28  class Base<decltype(Foo(T()))>::type C; // expected-error {{no matching function for call to 'Foo'}}
29  return C;
30}
31struct Z {
32  int X : func<int>(); // expected-note {{in instantiation of function template}}
33};
34constexpr int ssss = sizeof(Z);
35
36struct Z2 {
37  int X : sizeof(_ExtInt(invalid())); // expected-error {{use of undeclared identifier}}
38};
39constexpr int sssss = sizeof(Z2);
40