[PATCH] D40381: Parse concept definition

changyu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 24 10:38:58 PST 2017


changyu added a comment.

I don't have commit privilege. And also there's one more problem we might want to address first.

Thank you.



================
Comment at: lib/Parse/ParseTemplate.cpp:181
+    TemplateParameterList *TPL = ParamLists[0];
+    if (TPL->getLAngleLoc().getLocWithOffset(1) == TPL->getRAngleLoc()) {
+      Diag(TPL->getTemplateLoc(),
----------------
There's one problem here.

​I added this `if` in attempt to catch the following case (but it's wrong)
```
	​template<> concept D1 = true;  // expected-error {{expected template parameter}}
```
The problem is I'm not sure how to differentiate between the above situation and the following
```
	​template<concept T> concept D1 = true; // expected-error {{expected template parameter}}
```
Both have an empty template parameter list​. The latter case has diagnostic printed by `ParseNonTypeTemplateParameter` while the former has not (so we try to catch it here).

What should we do?



https://reviews.llvm.org/D40381





More information about the cfe-commits mailing list