This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add test for CWG1894 and CWG2199
ClosedPublic

Authored by Endill on Apr 12 2023, 8:26 AM.

Details

Reviewers
shafik
cor3ntin
Group Reviewers
Restricted Project
Commits
rG576c752410e7: [clang] Add test for CWG1894 and CWG2199
Summary

P1787: CWG1894 and its duplicate CWG2199 are resolved per Richard’s proposal for “dr407 still leaves open questions about typedef / tag hiding”, using generic conflicting-declaration rules even for typedef, and discarding a redundant typedef-name when looking up an elaborated-type-specifier.
Wording: See changes to [dcl.typedef], [basic.lookup.elab], and [basic.lookup]/4.

Generic conflicting-declaration rules are specified in changes to [basic.scope.scope]. CWG407, CWG1894, and CWG2199 discuss how elaborated type specifiers interact with typedefs, using directives, and using declarations. Since existing test for CWG407 covers examples provided in CWG1894 and CWG2199, and does it in accordance with P1787, I reused parts of it.

Diff Detail

Event Timeline

Endill created this revision.Apr 12 2023, 8:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2023, 8:26 AM
Endill requested review of this revision.Apr 12 2023, 8:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2023, 8:26 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Endill edited the summary of this revision. (Show Details)Apr 12 2023, 8:26 AM
cor3ntin added inline comments.
clang/test/CXX/drs/dr18xx.cpp
172–227

I think i would prefer reusing verbatim the example in 1894 - lines 207 and following basically - as the issue clearly state that what comes before is resolved by 407 so not really relevant here

Thank you for taking a look at this.

clang/test/CXX/drs/dr18xx.cpp
172–227

Does the same apply to 2199? It also contains examples resolved by 407.

cor3ntin added inline comments.Apr 12 2023, 10:42 AM
clang/test/CXX/drs/dr18xx.cpp
172–227

Yes, i think so. That way it better shows what is actually resolved / tested - amd avoid to much duplication

cor3ntin added inline comments.Apr 12 2023, 10:44 AM
clang/www/cxx_dr_status.html
13004

I would just say "Yes", i think clang 3.8 predates these issues

Endill added inline comments.Apr 12 2023, 10:54 AM
clang/www/cxx_dr_status.html
13004

It's not the case: 2199 was filed 12.11.2015, but 3.8 was released on 08.03.2016.

erichkeane added inline comments.
clang/www/cxx_dr_status.html
13004

I don't think that is a policy we have anyway. We frequently just say "this has worked since Clang X.X" even with much more recent DRs than the release.

Endill added inline comments.Apr 12 2023, 11:06 AM
clang/www/cxx_dr_status.html
13004

Yes, up until now I'd just throw tests into compiler explorer, and look when clang started behaving the way it does today. I say "Yes" upon hitting 3.0, which is the oldest available.

Endill updated this revision to Diff 512910.Apr 12 2023, 11:12 AM
Endill edited the summary of this revision. (Show Details)

Remove parts of CWG1894 and CWG2199 tests that are resolved by CWG407

cor3ntin accepted this revision.Apr 13 2023, 11:51 PM

LGTM, thanks!

clang/www/cxx_dr_status.html
13004

Got it, thanks!

This revision is now accepted and ready to land.Apr 13 2023, 11:51 PM
This revision was landed with ongoing or failed builds.Apr 14 2023, 12:15 AM
This revision was automatically updated to reflect the committed changes.