This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add test for CWG1710 and related issues
ClosedPublic

Authored by Endill on May 30 2023, 1:52 AM.

Details

Reviewers
shafik
cor3ntin
Group Reviewers
Restricted Project
Commits
rG1bbaabb90dd7: [clang] Add test for CWG1710 and related issues
Summary

Those issues focus on template keyword being optional in certain type-only contexts (base specifiers, member initializers, typename specifiers), as opposed to be disallowed by the grammar, or required by some implementations. GCC accepts all the tests this patch touches since 10, others fail on various tests: https://godbolt.org/z/1M6KE3W1a

It should be noted that the wording in 1710 that resolves those issues has been substantially changed by P1787. I can't find the post-P1787 wording that covers those issues, but I can't find the intent of changing relevant behavior in P1787 either, so I assume that intent of the 1710 resolution is preserved somewhere.

This patch covers the following issues:
CWG314
CWG343
CWG1710
CWG1794
CWG1812

Diff Detail

Event Timeline

Endill created this revision.May 30 2023, 1:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2023, 1:52 AM
Endill requested review of this revision.May 30 2023, 1:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2023, 1:52 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
cor3ntin accepted this revision.Jun 28 2023, 7:18 AM
cor3ntin added a subscriber: cor3ntin.

Thanks.
These seem like important issues to fix. should we make a github issue to track them?

clang/test/CXX/drs/dr17xx.cpp
10
This revision is now accepted and ready to land.Jun 28 2023, 7:18 AM

Thank you for taking a look!
I found a bunch of issues pointing at the same diagnostics, but I'm not sure if they track exactly what I test here:
https://github.com/llvm/llvm-project/issues/17775
https://github.com/llvm/llvm-project/issues/36539
https://github.com/llvm/llvm-project/issues/38395
https://github.com/llvm/llvm-project/issues/57019

This revision was automatically updated to reflect the committed changes.