This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Fix unknown type attributes diagnosed twice with [[]] spelling
ClosedPublic

Authored by junaire on Apr 8 2022, 11:37 PM.

Details

Summary

Don't warn on unknown type attributes in Parser::ProhibitCXX11Attributes
for most cases, but left the diagnostic to the later checks.
module declaration and module import declaration are special cases.

Fixes https://github.com/llvm/llvm-project/issues/54817

Diff Detail

Event Timeline

junaire created this revision.Apr 8 2022, 11:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2022, 11:37 PM
junaire requested review of this revision.Apr 8 2022, 11:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2022, 11:37 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
junaire updated this revision to Diff 421695.Apr 8 2022, 11:51 PM

Add a missing test.

junaire updated this revision to Diff 421696.Apr 9 2022, 12:17 AM

Update the test.

junaire updated this revision to Diff 421719.Apr 9 2022, 4:46 AM

Rename an argument for consistency.

aaron.ballman accepted this revision.Apr 11 2022, 7:39 AM

Thank you for the fix! Can you add a release note for it as well?

LGTM aside from a minor nit with some comment wording and a testing suggestion.

clang/test/SemaCXX/warn-once-on-unknown-attr.cpp
2

Can you also add this RUN line?

// RUN: %clang_cc1 -fsyntax-only -verify -std=c2x -x c %s

Then we're verifying that we didn't do anything different for C.

This revision is now accepted and ready to land.Apr 11 2022, 7:39 AM
junaire updated this revision to Diff 422094.Apr 11 2022, 6:51 PM

Run test in C2x mode.

junaire updated this revision to Diff 422096.Apr 11 2022, 6:55 PM

Add release note.

Thank you for the fix! Can you add a release note for it as well?

LGTM aside from a minor nit with some comment wording and a testing suggestion.

Hey Aaron, thanks for your review :) I'm not an expert in C or C++, so I'd appreciate it if you can provide better wording.

aaron.ballman accepted this revision.Apr 12 2022, 4:47 AM

I did some minor changes to the release note, but otherwise LGTM!

clang/docs/ReleaseNotes.rst
116–117
This revision was landed with ongoing or failed builds.Apr 12 2022, 6:12 AM
This revision was automatically updated to reflect the committed changes.