What to do about accidental C++20 method usage?

21 views
Skip to first unread message

Marshall Greenblatt

unread,
Aug 25, 2022, 12:56:03 PM8/25/22
to cxx, andre...@arm.com, li...@chromium.org
Hi All,

A recent change introduced usage of std::atomic_flag::test() (code here). This method appears to have been added in C++20. Is this type of C++20 usage allowed if it passes the builders and OWNER code review? If not (as indicated here), should we somehow improve our tooling to catch this disallowed usage prior to merge?

Thanks,
Marshall

Peter Kasting

unread,
Aug 25, 2022, 1:08:12 PM8/25/22
to Marshall Greenblatt, cxx, andre...@arm.com, li...@chromium.org
On Thu, Aug 25, 2022 at 9:56 AM Marshall Greenblatt <magree...@gmail.com> wrote:
A recent change introduced usage of std::atomic_flag::test() (code here). This method appears to have been added in C++20. Is this type of C++20 usage allowed if it passes the builders and OWNER code review? If not (as indicated here), should we somehow improve our tooling to catch this disallowed usage prior to merge?

It's not allowed, but ideally it shouldn't have compiled in --std=c++17 if the method is C++20.  I consider other behavior a bug in libc++ and I would suggest filing an LLVM bug for it?

PK

Marshall Greenblatt

unread,
Aug 25, 2022, 1:33:08 PM8/25/22
to Peter Kasting, cxx, andre...@arm.com, li...@chromium.org
Thanks, that explains it. I've filed https://github.com/llvm/llvm-project/issues/57364
 

PK
Reply all
Reply to author
Forward
0 new messages