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

Hubert Tong hubert.reinterpretcast at gmail.com
Thu Jun 18 16:56:03 PDT 2015


================
Comment at: test/Parser/cxx-concepts-value-function.cpp:11
@@ +10,3 @@
+
+#ifdef DIAG
+
----------------
rsmith wrote:
> nwilson wrote:
> > rsmith wrote:
> > > 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`.
> > I'll submit a patch for this shortly so you guys can see if this explanation doesn't make sense. But, how about if I use the directives likes this:
> > 
> > #if DIAG == 0
> > // RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s -DDIAG=0
> > // expected-no-diagnostics
> > 
> > *** test cases ***
> > 
> > #elif DIAG == 1
> > // RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s -DDIAG=1
> > 
> > *** test cases ***
> > 
> > #endif
> > 
> > 
> What are you trying to achieve by running the test twice?
The presence of errors in a file may prevent further processing. Such further processing is not guaranteed to apply only to code which occurs lexically after the location of the error. By avoiding diagnostic cases in one of the runs, we can be more confident that the cases which should not receive diagnostics would not do so (instead of merely having the unexpected diagnostics conveniently preempted).

http://reviews.llvm.org/D10528

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






More information about the cfe-commits mailing list