Commit Graph

4 Commits

Author SHA1 Message Date
Doug Gregor
e4cf74abfa Update expected diagnostics to match what SwiftIfConfig produces
For the most part, the differences between the diagnostics introduced
by the C++ implementation and the new SwiftIfConfig implementation are
cosmetic, so these are only wording changes.

The one major difference is that we've dropped the warnings about
potential typos in os/arch checks. For example, if one writes:

    #if os(bisionos)
    // ...
    #endif

The C++ implementation will produce a warning "unknown operating system
for build configuration 'os'" with a note asking "did you mean
'visionOS'"? These warnings rely on a static list of known operating
systems and architectures, which is somewhat unfortunate: the whole
point of these checks is that the Swift you're dealing with might not
have support for those operating systems/architectures, so while these
warnings can be helpful in a few cases, they also cause false
positives when porting. Therefore, I chose not to bring them forward.
2024-08-24 21:31:41 -07:00
Allan Shortlidge
ed77b8ff32 AST: #if hasAttribute(retroactive) should evaluate true.
The implementation of `#if hasAttribute(...)` only accepted declaration
attributes. It should also accept type attributes, like `@retroactive`.

Resolves rdar://125195051
2024-03-25 14:03:00 -07:00
Rintaro Ishizaki
47372122a1 [Parse] Adjust diagnostic location for platform condition arguments
Previously, diagnostics for arguments of platform conditions (e.g.
'os(macOS)') used to point the condition name position instead of the
argument position.
Adjust the position to the start of the argument.

rdar://124160048
2024-03-18 23:23:27 +09:00
Doug Gregor
7a75ddafe1 Add "#if hasAttribute(X)" support query attributes. 2022-07-25 21:31:16 -04:00