This is an archive of the discontinued LLVM Phabricator instance.

Remove unnecessary template specifiers from truct constructors in tests.
ClosedPublic

Authored by massberg on Jan 10 2023, 12:27 AM.

Details

Summary

As far as I can see they are unnecessary and in C++20 they lead to errors.
Removing them the tests pass with C++20 and the default version.
Example error message:

llvm-project/llvm/unittests/IR/PassBuilderCallbacksTest.cpp:275:30: error: expected unqualified-id before ‘)’ token
  275 |   MockAnalysisHandle<Module>() { setDefaults(); }

Diff Detail

Event Timeline

massberg created this revision.Jan 10 2023, 12:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2023, 12:27 AM
massberg requested review of this revision.Jan 10 2023, 12:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2023, 12:27 AM
ilya-biryukov accepted this revision.Jan 10 2023, 2:40 AM

LGTM to unbreak the buildbots, this change definitely does not change semantics.

I wonder what caused it to break in C++20, though. Any ideas?

This revision is now accepted and ready to land.Jan 10 2023, 2:40 AM

Thanks for the pointers! Clang does not seem to diagnose or forbid this even in trunk. I suspect the DR is not yet implemented, but there are other changes to the parser that cause these errors? 'Down with typename' maybe?

Thanks for the pointers! Clang does not seem to diagnose or forbid this even in trunk. I suspect the DR is not yet implemented, but there are other changes to the parser that cause these errors? 'Down with typename' maybe?

I assumed the host compiler was GCC which should check for this... If this is actually an error when compiling with Clang it's pretty weird.