[PATCH] D90188: Add support for attribute 'using_if_exists'

2021-06-02 Thread Louis Dionne via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG369c64839946: [clang] Implement the using_if_exists attribute (authored by erik.pilkington, committed by ldionne). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D90188: Add support for attribute 'using_if_exists'

2021-06-01 Thread Louis Dionne via Phabricator via cfe-commits
ldionne updated this revision to Diff 349087. ldionne added a comment. Fix CI issues (hopefully - at least everything runs locally). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90188/new/ https://reviews.llvm.org/D90188 Files:

[PATCH] D90188: Add support for attribute 'using_if_exists'

2021-06-01 Thread Louis Dionne via Phabricator via cfe-commits
ldionne updated this revision to Diff 349010. ldionne added a comment. Run clang-format. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90188/new/ https://reviews.llvm.org/D90188 Files: clang/include/clang/AST/DeclCXX.h

[PATCH] D90188: Add support for attribute 'using_if_exists'

2021-06-01 Thread Louis Dionne via Phabricator via cfe-commits
ldionne updated this revision to Diff 348952. ldionne added a comment. Rebase onto main to trigger CI. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90188/new/ https://reviews.llvm.org/D90188 Files: clang/include/clang/AST/DeclCXX.h

[PATCH] D90188: Add support for attribute 'using_if_exists'

2021-05-31 Thread Louis Dionne via Phabricator via cfe-commits
ldionne updated this revision to Diff 348810. ldionne added a comment. Herald added a project: clang. Rebase onto `main`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90188/new/ https://reviews.llvm.org/D90188 Files:

[PATCH] D90188: Add support for attribute 'using_if_exists'

2021-04-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Does anyone have any remaining concerns or a desire to take another pass through this patch? If not, then I'll commit this later this week on Aaron's LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90188/new/ https://reviews.llvm.org/D90188

[PATCH] D90188: Add support for attribute 'using_if_exists'

2021-04-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/SemaCXX/using-if-exists.cpp:79 + using B::mf UIE; // expected-note {{using declaration annotated with 'using_if_exists' here}} + using typename B::mt UIE; // expected-note 2 {{using declaration annotated with

[PATCH] D90188: Add support for attribute 'using_if_exists'

2021-04-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90188/new/ https://reviews.llvm.org/D90188 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D90188: Add support for attribute 'using_if_exists'

2021-03-29 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/test/SemaCXX/using-if-exists.cpp:11 + +using NotNS::x UIE; // expected-error{{use of undeclared identifier 'NotNS'}} +} // test_basic Quuxplusone wrote: > Do you also have a test for `using NS::NotNS::x

[PATCH] D90188: Add support for attribute 'using_if_exists'

2021-03-29 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 333873. erik.pilkington marked 4 inline comments as done. erik.pilkington added a comment. Address review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90188/new/ https://reviews.llvm.org/D90188 Files:

[PATCH] D90188: Add support for attribute 'using_if_exists'

2021-01-19 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments. Comment at: clang/test/SemaCXX/using-if-exists.cpp:11 + +using NotNS::x UIE; // expected-error{{use of undeclared identifier 'NotNS'}} +} // test_basic Do you also have a test for `using NS::NotNS::x UIE;`? (Both of these

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-12-04 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM aside from a minor nit, thank you! Comment at: clang/lib/Sema/SemaDeclCXX.cpp:11681 + if (isa(Target) != + (NonTag && isa(NonTag))) { +if

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Serialization/ASTReaderDecl.cpp:1704-1707 +void ASTDeclReader::VisitUnresolvedUsingIfExistsDecl( +UnresolvedUsingIfExistsDecl *D) { + VisitNamedDecl(D); +} aaron.ballman wrote: > I'm not super

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 307670. erik.pilkington marked 4 inline comments as done. erik.pilkington added a comment. Address review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90188/new/ https://reviews.llvm.org/D90188 Files:

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:442 +// Make the selection of the recovery decl deterministic. +(RealRes)->getLocation().getRawEncoding() < IIDecl->getLocation().getRawEncoding())

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-17 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In D90188#2397441 , @aaron.ballman wrote: > FWIW, it'd be a bit easier if those changes were split off into their own > patch, as they're orthogonal to `using_if_exists`. Ok, I moved this part to:

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-17 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 305788. erik.pilkington marked 6 inline comments as done. erik.pilkington added a comment. Split off parsing support for C++ attributes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90188/new/ https://reviews.llvm.org/D90188 Files:

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D90188#2394361 , @erik.pilkington wrote: > Add support for C++11-style attributes on using-declarations. FWIW, it'd be a bit easier if those changes were split off into their own patch, as they're orthogonal to

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 305193. erik.pilkington marked 2 inline comments as done. erik.pilkington added a comment. Herald added a subscriber: jdoerfert. Add support for C++11-style attributes on using-declarations. CHANGES SINCE LAST ACTION

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-10 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:5273 + namespace empty_namespace {}; + using empty_namespace::does_not_exist __attribute__((using_if_exists)); // no error! + aaron.ballman wrote: > Mordante wrote: > >

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-04 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:5273 + namespace empty_namespace {}; + using empty_namespace::does_not_exist __attribute__((using_if_exists)); // no error! + Mordante wrote: > erik.pilkington wrote: > >

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-04 Thread Mark de Wever via Phabricator via cfe-commits
Mordante added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:5273 + namespace empty_namespace {}; + using empty_namespace::does_not_exist __attribute__((using_if_exists)); // no error! + erik.pilkington wrote: > aaron.ballman wrote: > >

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-04 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/AST/DeclCXX.h:3801 +/// error. +class UnresolvedUsingIfExistsDecl final : public NamedDecl { + UnresolvedUsingIfExistsDecl(DeclContext *DC, SourceLocation Loc, erik.pilkington wrote: >

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington marked 3 inline comments as done. erik.pilkington added inline comments. Comment at: clang/include/clang/AST/DeclCXX.h:3801 +/// error. +class UnresolvedUsingIfExistsDecl final : public NamedDecl { + UnresolvedUsingIfExistsDecl(DeclContext *DC, SourceLocation

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-04 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/AST/DeclCXX.h:3801 +/// error. +class UnresolvedUsingIfExistsDecl final : public NamedDecl { + UnresolvedUsingIfExistsDecl(DeclContext *DC, SourceLocation Loc, erik.pilkington wrote: >

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 302733. erik.pilkington marked 20 inline comments as done. erik.pilkington added a comment. Address review comments, thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90188/new/ https://reviews.llvm.org/D90188 Files:

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/AST/DeclCXX.h:3801 +/// error. +class UnresolvedUsingIfExistsDecl final : public NamedDecl { + UnresolvedUsingIfExistsDecl(DeclContext *DC, SourceLocation Loc, aaron.ballman wrote: > Why is

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-11-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/AST/DeclCXX.h:3801 +/// error. +class UnresolvedUsingIfExistsDecl final : public NamedDecl { + UnresolvedUsingIfExistsDecl(DeclContext *DC, SourceLocation Loc, Why is this inheriting from a

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-10-27 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In addition to moving the diagnostic to `DiagnoseUseOfDecl`, you may well get better error recovery if you teach `ClassifyName` about the new kind of declaration, and have it `DiagnoseUseOfDecl` it immediately and return `NameClassification::Error()` -- that way, the

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-10-27 Thread Mark de Wever via Phabricator via cfe-commits
Mordante added a comment. A few questions. I'm not familiar enough with the code to accept the patch. Comment at: clang/include/clang/Basic/AttrDocs.td:5266 + let Content = [{ +The using_if_exists attribute applies to a using-declaration. It allows +programmers to import a

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-10-27 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/test/SemaCXX/using-if-exists-attr.cpp:16 +template +using template_alias UIE = NS::x; // expected-warning {{'using_if_exists' attribute only applies to named declarations, types, and value declarations}} +

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-10-27 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added inline comments. Comment at: clang/test/SemaCXX/using-if-exists-attr.cpp:16 +template +using template_alias UIE = NS::x; // expected-warning {{'using_if_exists' attribute only applies to named declarations, types, and value declarations}} + I

[PATCH] D90188: Add support for attribute 'using_if_exists'

2020-10-26 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, aaron.ballman, ldionne. Herald added subscribers: dexonsmith, ributzka, arphaman, jkorous. erik.pilkington requested review of this revision. This attribute applies to a using declaration, and permits importing a