nickdesaulniers added inline comments.
================ Comment at: clang/lib/Sema/SemaDecl.cpp:3368 + Diag(Old->getLocation(), diag::note_previous_declaration); + New->dropAttr<InternalLinkageAttr>(); + } ---------------- Should be dropping `ErrorAttr`. ================ Comment at: clang/test/Sema/attr-error.c:26 + +__attribute__((error("foo"), warning("foo"))) // expected-error {{'warning' and 'error' attributes are not compatible}} +int ---------------- aaron.ballman wrote: > Can you also add a test for: > ``` > __attribute__((error("foo"))) int bad5(void); // expected-note {{conflicting > attribute is here}} > __attribute__((warning("foo"))) int bad5(void); // expected-error {{'warning' > and 'error' attributes are not compatible}} > ``` Ah, that exposes the case you discussed above: > I think you need to follow the attribute merge pattern used in SemaDecl.cpp. So I did a relatively larger refactor to support that. Doing so required me to make this an InheritableAttr. PTAL Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106030/new/ https://reviews.llvm.org/D106030 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits