File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -2406,7 +2406,8 @@ class DeclAndTypePrinter::Implementation
24062406 }
24072407
24082408 void maybePrintTagKeyword (const TypeDecl *NTD) {
2409- if (auto *ED = dyn_cast<EnumDecl>(NTD); !NTD->hasClangNode ()) {
2409+ auto *ED = dyn_cast<EnumDecl>(NTD);
2410+ if (ED && !NTD->hasClangNode ()) {
24102411 if (ED->getAttrs ().hasAttribute <CDeclAttr>()) {
24112412 // We should be able to use the tag macro for all printed enums but
24122413 // for now restrict it to @cdecl to guard it behind the feature flag.
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+
3+ // Test the behavior of printing Unicode.Scalar in the compatibility header.
4+ // This is wrong, it should either be rejected and considered non-representable
5+ // or actually be printed using a C / Objective-C compatible type.
6+
7+ // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) \
8+ // RUN: %s -emit-module -verify -o %t \
9+ // RUN: -emit-clang-header-path %t/compat.h
10+ // RUN: %FileCheck %s --input-file %t/compat.h
11+
12+ @_cdecl ( " referencesScalar " )
13+ func referencesScalar( ) -> Unicode . Scalar { fatalError ( ) }
14+ // CHECK: SWIFT_EXTERN Scalar referencesScalar(void)
You can’t perform that action at this time.
0 commit comments