[PATCH] [PATCH] [CONCEPTS] Parsing of concept keyword
Nathan Wilson
nwilson20 at gmail.com
Thu Jun 18 20:45:54 PDT 2015
================
Comment at: test/Parser/cxx-concepts-value-function.cpp:1
@@ +1,2 @@
+
+// Support parsing of function concepts and variable concepts
----------------
hubert.reinterpretcast wrote:
> rsmith wrote:
> > The name of this test file could be better. Something like 'cxx-concept-declaration.cpp', maybe, if you're intending on putting tests for the other parsing changes (requires-clauses, requires-expressions, concept-introducer syntax, ...) into separate files?
> There is a patch for requires-clauses here in case we want to coordinate the filenames: http://reviews.llvm.org/D10462.
Yeah, I wasn't sure about the file name. I'd be okay with cxx-concept-declaration.cpp.
Hubert - do you have any preference?
================
Comment at: test/Parser/cxx-concepts-value-function.cpp:30
@@ +29,2 @@
+
+template< concept T > concept bool D2 { return true; } // expected-error {{unknown type name 'T'}} expected-error {{expected expression}} expected-error {{expected ';' at end of declaration}}
----------------
rsmith wrote:
> nwilson wrote:
> > Is there a better way to list multiple diagnostics that would occur from the same declaration? When separating out each declaration for each test case such as:
> >
> > template< concept T > concept bool D2 { return true; } // expected-error {{unknown type name 'T'}}
> > template< concept T > concept bool D3 { return true; } // expected-error {{expected expression}}
> > template< concept T > concept bool D4 { return true; } // expected-error {{expected ';' at end of declaration}}
> >
> > clang complains:
> > 'error' diagnostics seen but not expected:
> >
> > and lists all of the diagnostics.
> >
> Try changing your test so each case only fails in one way. Like:
>
> template< concept T > concept bool D2 = true; // expected-error {{unknown type name 'T'}}
> template< typename T > concept bool D3 { return true; }; // expected-error {{expected expression}}
> template< typename T > concept bool D4 { true } // expected-error {{expected ';' at end of declaration}}
>
> ... though the second and third cases are really testing variable/function disambiguation and don't have anything to do with concepts, so I'm not sure they belong here at all.
Ahh, yeah, that makes sense. Thanks. I'll take the last two out in that case, and add more when adding actual diagnostics for ill formed concept declarations.
http://reviews.llvm.org/D10528
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list