This is an archive of the discontinued LLVM Phabricator instance.

[clang] Allow LifetimeExtendedTemporary to have no access specifier
ClosedPublic

Authored by adamcz on Jan 15 2021, 9:42 AM.

Details

Summary

The check only runs in debug mode during serialization, but
assert()-fail on:

struct S { const int& x = 7; };

in C++ mode.

Diff Detail

Event Timeline

adamcz requested review of this revision.Jan 15 2021, 9:42 AM
adamcz created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 15 2021, 9:42 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
hokein accepted this revision.Jan 18 2021, 2:38 AM

thanks.

clang/lib/AST/DeclBase.cpp
986

nit: personally I'd keep the old format style, just appending the new case.

This revision is now accepted and ready to land.Jan 18 2021, 2:38 AM
adamcz added inline comments.Jan 18 2021, 8:12 AM
clang/lib/AST/DeclBase.cpp
986

I like the old formatting a little better too, but this is what clang-format wants to do and I think keeping the code clang-format clean is more valuable in this case. Otherwise everyone submitting here must ignore/silence formatting errors and can no longer auto-format this file.