1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only %s -verify 2*f4a2713aSLionel Sambuc // PR5692 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc enum x; // expected-note {{forward declaration}} 5*f4a2713aSLionel Sambuc extern struct y a; // expected-note {{forward declaration}} 6*f4a2713aSLionel Sambuc extern union z b; // expected-note 2 {{forward declaration}} 7*f4a2713aSLionel Sambuc foo()8*f4a2713aSLionel Sambucvoid foo() { 9*f4a2713aSLionel Sambuc (enum x)1; // expected-error {{cast to incomplete type}} 10*f4a2713aSLionel Sambuc (struct y)a; // expected-error {{cast to incomplete type}} 11*f4a2713aSLionel Sambuc (union z)b; // expected-error {{cast to incomplete type}} 12*f4a2713aSLionel Sambuc (union z)1; // expected-error {{cast to incomplete type}} 13*f4a2713aSLionel Sambuc } 14*f4a2713aSLionel Sambuc 15