This is an archive of the discontinued LLVM Phabricator instance.

Stop using "template" when printing qualtype names
ClosedPublic

Authored by saugustine on Feb 12 2016, 1:56 PM.

Details

Summary

The keyword "template" isn't necessary when
printing a fully-qualified qualtype name, and, in fact,
results in a syntax error if one tries to use it. So stop
printing it.

Diff Detail

Repository
rL LLVM

Event Timeline

saugustine updated this revision to Diff 47854.Feb 12 2016, 1:56 PM
saugustine retitled this revision from to Stop using "template" when printing qualtype names.
saugustine updated this object.
saugustine added a reviewer: rsmith.
saugustine added subscribers: cfe-commits, klimek.
rnk accepted this revision.Feb 12 2016, 2:09 PM
rnk added a reviewer: rnk.
rnk added a subscriber: rnk.

lgtm

This code seems like it's intended to avoid operating on dependent types, so it shouldn't need the template keyword. It's hard to have a fully qualified name that's valid at global scope and still somehow mentions template parameters.

unittests/Tooling/QualTypeNamesTest.cpp
138 ↗(On Diff #47854)

What's supposed to be printed for dependent_type_var?

This revision is now accepted and ready to land.Feb 12 2016, 2:09 PM

Thanks for the quick review. Assuming my response to your comment on line 138 is adequate, would you mind checking it in?

unittests/Tooling/QualTypeNamesTest.cpp
138 ↗(On Diff #47854)

I'm not clever enough to generate one that compiles when it is at the end of the TU.

When not at the end of the TU, this prints: FOO<X>::dependent_type, omitting the keyword.

I don't think this is worth adding as a test-case.

saugustine requested a review of this revision.Feb 16 2016, 11:36 AM
saugustine edited edge metadata.

Would you mind reviewing this, and checking it in if you find it acceptable?

This revision was automatically updated to reflect the committed changes.