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

Hubert Tong hubert.reinterpretcast at gmail.com
Thu Jun 18 06:05:38 PDT 2015


Some issues with the test case; minor issues otherwise.

I would suggest testing the following as well:

  template <typename T>
  struct A { typedef bool Boolean; };
  
  template <int N>
  A<void>::Boolean concept C3(!0);
  
  template <typename T, int = 0>
  concept auto C4(void) -> bool { return true; }
  
  constexpr int One = 1;
  
  template <typename>
  static concept decltype(!0) C5{ bool(One) };


================
Comment at: lib/Parse/ParseDecl.cpp:4438
@@ -4432,1 +4437,3 @@
 
+    // C++TS1 concept
+  case tok::kw_concept:
----------------
I'm not sure what C++TS1 is meant to refer to since the Concepts TS is not TS1.

================
Comment at: test/Parser/cxx-concepts-value-function.cpp:1
@@ +1,2 @@
+// RUN:  %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify -DDIAG=0|1 %s
+
----------------
I am not familiar with the 0|1 syntax being used here; my local copy of "lit" interprets it as a pipe to a command "1". Perhaps this should be two run lines?

================
Comment at: test/Parser/cxx-concepts-value-function.cpp:4
@@ +3,3 @@
+/******************************************************************************
+* Support parsing of concept values and functions
+ ******************************************************************************/
----------------
The usual way to express this is "function concepts and variable concepts".

================
Comment at: test/Parser/cxx-concepts-value-function.cpp:11
@@ +10,3 @@
+
+#ifdef DIAG
+
----------------
-DDIAG=0 would still trigger the #ifdef DIAG here (which explains why the test file might pass with expected-no-diagnostics).

http://reviews.llvm.org/D10528

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






More information about the cfe-commits mailing list