rsmith added a comment.

I don't see how this approach can work; the fact that we happened to ask the 
expression evaluator to evaluate an expression is not sufficient reason for us 
to issue this warning. For instance:

  auto a = []{};
  void (*p)() = a;

... will ask the evaluator to evaluate the initializer of `p`, which it appears 
will now generate a bogus extension warning in C++11 and C++14 mode.

If you want to carry on down this path, I think you will need to do something 
similar to what we discussed at Oulu, but I expect getting a correct warning to 
be complex and difficult, so I think the best approach would be to give up on 
this compat warning / extension, and instead only turn on the `constexpr` flag 
in C++17 mode. We could burn a lot of time getting this compatibility warning / 
extwarn to work, and it seems better to make progress on the rest of the 
constexpr lambdas feature instead :)


https://reviews.llvm.org/D18510



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to