rjmccall added a comment.

I agree that tools shouldn't be forced to deal with invalid AST that looks like 
valid AST.  To me that means finding ways to preserve information that (1) 
don't badly violate invariants and (2) are easily discoverable as invalid.  For 
`case`, which has external requirements (e.g. not being a duplicate value) not 
entirely dissimilar to a declaration, I think that means having an "invalid" 
flag; arbitrary tools already can't rely on the expression being 
constant-evaluable because of templates, although granted many tools might 
never look at template patterns.  For other things (e.g. a binary operator) 
maybe that means using different classes (e.g. `InvalidBinaryOperator`) so that 
tools looking at an apparently well-typed expression don't need to consider 
totally invalid possibilities.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63139/new/

https://reviews.llvm.org/D63139



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

Reply via email to