The [[carries_dependency]] attribute was added to the standard in C++11, but implementations have (uniformly, as best I can tell) been ignoring this attribute for the past decade. In Clang, we would parse the attribute and otherwise do nothing useful with it (no additional analyses, no communication of the attribute to the backend, etc). As far as I know, we have no future plans to implement the semantics of the attribute. However, __has_cpp_attribute(carries_dependency) returns a nonzero value which suggests we actually do support the attribute and do useful things with it, especially because we documented that it might improve performance.
This removes all support for [[carries_dependency]] and treats it as an unknown attribute instead (the same as we do for other standard attributes we don't support, like [[no_unique_address]] on some targets). We now return zero from __has_cpp_attribute(carries_dependency), which matches the behavior of GCC.
I can find no evidence of user code that should be impacted by this. All uses of the GNU version of the attribute were in compiler test suites: https://sourcegraph.com/search?q=context:global+__attribute__%28%28carries_dependency%29%29+-file:.*test.*+-file:clang&patternType=standard&sm=1&groupBy=repo All uses of the C++ version of the attribute are also in compiler implementations or documentation: https://sourcegraph.com/search?q=context:global+%5B%5Bcarries_dependency%5D%5D+-file:.*test.*+-file:clang&patternType=standard&sm=1&groupBy=repo
Incidentally, this also helps people in WG21 build a case for deprecating and removing this attribute in a future revision of C++.