This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Parse restrict as a pointer qualifier
ClosedPublic

Authored by arichardson on Aug 27 2020, 6:46 AM.

Details

Summary

Before: void f() { MACRO(A * restrict a); }
After: void f() { MACRO(A *restrict a); }

Also check that the restrict and restrict__ aliases are handled.

Diff Detail

Event Timeline

arichardson created this revision.Aug 27 2020, 6:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 27 2020, 6:46 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
arichardson requested review of this revision.Aug 27 2020, 6:47 AM
JakeMerdichAMD accepted this revision.Aug 27 2020, 8:15 AM

LGTM, assuming tests pass (automated checks failed to resolve your patch since you based it off of your other one). Looks like enabling C99 should have no other effects, right?

This revision is now accepted and ready to land.Aug 27 2020, 8:15 AM

LGTM, assuming tests pass (automated checks failed to resolve your patch since you based it off of your other one). Looks like enabling C99 should have no other effects, right?

Tests are passing locally. Looking at TokenKinds.def it seems the only thing setting C99 enables is restrict and inline (but we already get that via C++).

This revision was landed with ongoing or failed builds.Aug 28 2020, 3:32 AM
This revision was automatically updated to reflect the committed changes.