[PATCH] D143670: Stop claiming we support [[carries_dependency]]

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 9 16:54:58 PST 2023


erichkeane requested changes to this revision.
erichkeane added a comment.
This revision now requires changes to proceed.

The guidance from EWG this week and in the past was that we are always required to 'parse and diagnose appertainment' of standard attributes, but not to enable __has_cpp_attribute unless we actually 'do' something with it.  I intend/suggest we add a condition to the CXX tag of 'is supported' with some sort of conditional for checking diagnostic and O level (or just straight 'false' in this case).



================
Comment at: clang/lib/Sema/SemaDecl.cpp:3324
-  //   of the function specifies the carries_dependency attribute.
-  const CarriesDependencyAttr *CDA = newDecl->getAttr<CarriesDependencyAttr>();
-  if (CDA && !oldDecl->hasAttr<CarriesDependencyAttr>()) {
----------------
Unfortunately EWG guidance doesn't let us do this, we still have to enforce appertainment/etc, even if we claim not to support this.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:4038
-    //   of the function specifies the carries_dependency attribute.
-    const CarriesDependencyAttr *CDA = New->getAttr<CarriesDependencyAttr>();
-    if (CDA && !Old->hasAttr<CarriesDependencyAttr>()) {
----------------
Same here, we still have to carry it around.


================
Comment at: clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.depend/p1.cpp:7
+// attribute.
+#if __has_cpp_attribute(carries_dependency)
+#error "Did not expect to support carries_dependency"
----------------
These tests still need to be here, __has_cpp_attribute or not.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143670



More information about the cfe-commits mailing list