[PATCH] D138822: [clang] Add test for CWG36

Vlad Serebrennikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 30 07:43:06 PST 2022


Endill added inline comments.


================
Comment at: clang/test/CXX/drs/dr0xx.cpp:489
+
+    using B::i; // expected-error {{redeclaration of using declaration}}
+    using C::i; // expected-error {{redeclaration of using declaration}}
----------------
aaron.ballman wrote:
> Endill wrote:
> > erichkeane wrote:
> > > Endill wrote:
> > > > erichkeane wrote:
> > > > > As a nit, I prefer the 'notes' to live next to the error, and use a bookmark line-marker here.  My issue is basically how we have no way of knowing (particularly in template code...) what this diagnoses.
> > > > > 
> > > > > I would also think a dependent example of this diagnostic would be useful.
> > > > >I would also think a dependent example of this diagnostic would be useful.
> > > > Do you mean something of this sort: `using D<int>::i`?
> > > That is a good example too, but more a case where the using expression is dependent, so something like: `using Struct<T>::i` sorta thing
> > > I prefer the 'notes' to live next to the error
> > done
> > 
> > > I would also think a dependent example of this diagnostic would be useful.
> > I'm not sure how you wanted it to interact with virtual bases, so I wrote examples both with virtual bases and without
> > 
> > > use a bookmark line-marker here
> > While I'm sympathetic to your concern, and agree that bookmarks allow to order expected errors and notes in the order they would appear for user, searching for `@#` gives only 5 DR tests. If that's the direction we want DR tests to take, we should be explicit about this, because almost all existing tests have to be adjusted.
> > While I'm sympathetic to your concern, and agree that bookmarks allow to order expected errors and notes in the order they would appear for user, searching for @# gives only 5 DR tests. If that's the direction we want DR tests to take, we should be explicit about this, because almost all existing tests have to be adjusted.
> 
> FWIW, we don't have to adjust all the tests -- sometimes bookmarks make things more clear, other times they don't help all that much, and it's an equivalent test either way. My recommendation is to use bookmarks when you think they make sense to use or when a reviewer asks for one. Updating other tests can be done with NFC changes if someone sees a particular need.
> FWIW, we don't have to adjust all the tests -- sometimes bookmarks make things more clear, other times they don't help all that much, and it's an equivalent test either way. My recommendation is to use bookmarks when you think they make sense to use or when a reviewer asks for one. Updating other tests can be done with NFC changes if someone sees a particular need.

The concern about expected-note comments scattered across a test seems applicable to any test with more than one expected-warning or expected-error. If maintainers agree that it should be addressed with bookmarks, I'll update this patch, and make NFC commits to fix existing tests.

What I'd like to avoid is introducing even more inconsistencies into DR tests. Until very recently (before tests for 2565 and 2628), bookmarks have been used only under `#if __cplusplus`, where you don't have any other straightforward option (e.g. dr100).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822



More information about the cfe-commits mailing list