[Parse][SR-702] Disallow attributes before #if

This commit is contained in:
Rintaro Ishizaki
2016-08-11 23:36:17 +09:00
parent 56f7274cdf
commit 0bfa734c6a
2 changed files with 27 additions and 14 deletions

View File

@@ -1,5 +1,19 @@
// RUN: %target-parse-verify-swift
public
#if FOO // expected-error {{expected declaration}}
var val1: Int = 0
#else
var val1: UInt = 1
#endif
struct S2 { // expected-note {{in declaration of 'S2'}}
@available(*, deprecated)
#if FOO // expected-error {{expected declaration}}
func fn1() {}
#endif
}
class C { // expected-note 3 {{in declaration of 'C'}}
#if os(iOS)