This is an archive of the discontinued LLVM Phabricator instance.

[clang] [WIP] Reject non-declaration C++11 attributes on declarations.
AbandonedPublic

Authored by mboehme on Apr 20 2022, 3:12 AM.

Details

Reviewers
aaron.ballman
Summary

Note: This is an "alternative considered" to my preferred solution at https://reviews.llvm.org/D124919

DRAFT -- do not review.

Clang has allowed this so far, transferring the attributes to the declaration's
type instead, as would be done for GNU syntax attributes. However, the C++
standard is clear that attributes in certain positions appertain to the
declaration, so we shouldn't allow type attributes in these positions.

For backwards compatibility, we only warn on non-declaration attributes that we
have historically allowed to be put on declarations. We only produce errors for
new non-declaration attributes.

Depends On D111548

Diff Detail

Event Timeline

mboehme created this revision.Apr 20 2022, 3:12 AM
Herald added a project: Restricted Project. · View Herald Transcript
mboehme requested review of this revision.Apr 20 2022, 3:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2022, 3:12 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mboehme retitled this revision from [clang] Reject non-declaration C++11 attributes on declarations. to [clang] [draft] Reject non-declaration C++11 attributes on declarations..Apr 20 2022, 3:16 AM
mboehme edited the summary of this revision. (Show Details)
mboehme removed a reviewer: aaron.ballman.

I'd like to mark this patch as a draft so that Herald doesn't keep adding reviewers -- but I'm not sure how?

I'd like to mark this patch as a draft so that Herald doesn't keep adding reviewers -- but I'm not sure how?

In that case, I usually set the permissions on the review explicitly so that I'm the only one who can view the draft (but this means precommit CI won't run on it). Most often folks just add [WIP] to the title and reviewers know to ignore the review until the [WIP] is removed.

I'd like to mark this patch as a draft so that Herald doesn't keep adding reviewers -- but I'm not sure how?

In that case, I usually set the permissions on the review explicitly so that I'm the only one who can view the draft (but this means precommit CI won't run on it).

In this case, though, I want to be able to show the draft to others and discuss it with them. I guess this technique doesn't work for that?

Most often folks just add [WIP] to the title and reviewers know to ignore the review until the [WIP] is removed.

Ah -- thanks. I'll add [WIP[ then.

mboehme retitled this revision from [clang] [draft] Reject non-declaration C++11 attributes on declarations. to [clang] [WIP] Reject non-declaration C++11 attributes on declarations..Apr 20 2022, 6:08 AM

I'd like to mark this patch as a draft so that Herald doesn't keep adding reviewers -- but I'm not sure how?

In that case, I usually set the permissions on the review explicitly so that I'm the only one who can view the draft (but this means precommit CI won't run on it).

In this case, though, I want to be able to show the draft to others and discuss it with them. I guess this technique doesn't work for that?

FWIW, you can pick the specific list of folks you want to give permissions to if you know it's a limited group. (I've done this with Erich from time to time when I want a second set of eyes on an NFC change but don't want to bother the mailing lists with it.) However, it sounds to me like you want anyone to be able to come by and comment if they'd like while you're prepping the patch, so I'd stick with the [WIP] in the title like you've got.

[snip]

However, it sounds to me like you want anyone to be able to come by and comment if they'd like while you're prepping the patch, so I'd stick with the [WIP] in the title like you've got.

Exactly. Thanks for the explanations!

mboehme edited the summary of this revision. (Show Details)May 4 2022, 6:05 AM

It appears that we are converging on the approach in https://reviews.llvm.org/D126061, so I'm abandoning this revision.

mboehme abandoned this revision.May 25 2022, 7:22 AM