[PATCH] D114382: [clang] Fix wrong -Wunused-local-typedef warning within a template function

Kristina Bessonova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 10 02:47:44 PST 2021


krisb added a comment.

@rtrieu, thank you for looking at this! Do you have any comments about the rest of the patch? Do you think it makes sense?



================
Comment at: clang/test/Modules/odr_hash.cpp:4288
 S<X> s;
+// expected-error at first.h:* {{'ParameterTest::S::Foo' has different definitions in different modules; definition in module 'FirstModule' first difference is 1st parameter with name 'aaaa'}}
+// expected-note at second.h:* {{but in 'SecondModule' found 1st parameter with name 'asdf'}}
----------------
rtrieu wrote:
> krisb wrote:
> > I'm not sure what was the original intent of this test (i.e. whether it intentionally tests the fact that there is no error on an uninstantiated static member function). As well as it doesn't clear to me what is the role of the unused typedef here, but it starts triggering the error because of redecls() call on isReferenced() added by this patch.
> I've checked out the ODR Hashing versus the other cases.   The new error is in line with the other behavior.  Having this new error is okay.
Thank you for checking this!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114382



More information about the cfe-commits mailing list