[PATCH] D84005: Introduce ns_error_domain attribute.

Michael Forster via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 17 04:46:27 PDT 2020


MForster marked an inline comment as done and an inline comment as not done.
MForster added inline comments.


================
Comment at: clang/include/clang/Basic/Attr.td:1860
+def NSErrorDomain : Attr {
+  let Spellings = [GNU<"ns_error_domain">];
+  let Args = [IdentifierArgument<"ErrorDomain">];
----------------
gribozavr2 wrote:
> Could we try to add a list of subjects here? It seems like it is a type-only attribute, and most likely enum-only.
> 
> let Subjects = SubjectList<[Enum]>;
@milseman, could you comment on this? 

In the meantime I've added the restriction. Obviously this makes the tests fail. I will also test this change against the Swift unit tests.


================
Comment at: clang/test/Analysis/ns_error_enum.m:1
+// RUN: %clang_cc1 -verify %s
+
----------------
gribozavr2 wrote:
> This file is a `.m` -- any specific reason? I'd call it `.c` and run the test in C, Objective-C, and C++ modes (enums might work slightly differently, the name lookup functionality might work differently).
The test doesn't compile in C or C++ (`non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators?`). Not sure if it's worth adapting.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84005/new/

https://reviews.llvm.org/D84005





More information about the cfe-commits mailing list