[PATCH] [PATCH] [CONCEPTS] Parsing of concept keyword

Richard Smith richard at metafoo.co.uk
Thu Jun 18 13:14:15 PDT 2015


================
Comment at: lib/Sema/DeclSpec.cpp:899
@@ +898,3 @@
+  if (Concept_specified) {
+    DiagID = diag::warn_duplicate_declspec;
+    PrevSpec = "concept";
----------------
Why just a warning? [dcl.spec]/2 seems to apply to `concept` just like any other //decl-specifier//.

================
Comment at: test/Parser/cxx-concepts-value-function.cpp:3-4
@@ +2,4 @@
+
+/******************************************************************************
+* Support parsing of concept values and functions
+ ******************************************************************************/
----------------
We typically use BCPL `//`-comments in our C++ testcases, with no line-of-`*`s.

================
Comment at: test/Parser/cxx-concepts-value-function.cpp:11
@@ +10,3 @@
+
+#ifdef DIAG
+
----------------
hubert.reinterpretcast wrote:
> nwilson wrote:
> > hubert.reinterpretcast wrote:
> > > hubert.reinterpretcast wrote:
> > > > -DDIAG=0 would still trigger the #ifdef DIAG here (which explains why the test file might pass with expected-no-diagnostics).
> > > I meant //without// `expected-no-diagnostics` somewhere.
> > Hmm, yeah, I missed that and thought it was working. Is there a better way to use/suppress the diagnostic cases?
> `#if DIAG` instead of `#ifdef` would work. I guess `expected-no-diagnostics` could be in the `#else` for that.
Just run the test once, and remove the `#ifdef`.

================
Comment at: test/Parser/cxx-concepts-value-function.cpp:15
@@ +14,3 @@
+
+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}}
+
----------------
Which of the various errors on this line are you trying to test here?

http://reviews.llvm.org/D10528

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list