This is an archive of the discontinued LLVM Phabricator instance.

Don't parse non-template name as template name
AbandonedPublic

Authored by ismailp on Jan 30 2014, 2:39 PM.

Details

Reviewers
rsmith
Summary

PR18127: misparse of 'new struct S < ...' where S is not a template-name

If clang sees '<' token after an elaborated-type-specifier, it assumes elaborated-type-specifier refers to a template name, and then issues diagnostics concerning missing '>'.

We try to find corresponding '>' for diagnostics location purpose, and perform name lookup. Parser knows that it is not parsing a template. If name lookup doesn't find a name, we will keep issuing explicit instantiation/specialization of non-template class error.

Diff Detail

Event Timeline