aaron.ballman closed this revision.
aaron.ballman added a comment.

Thank you for the review. I've commit in 
819ff6b945816dce144c8be577a3c245f702b59c 
<https://reviews.llvm.org/rG819ff6b945816dce144c8be577a3c245f702b59c>



================
Comment at: clang/lib/ASTMatchers/Dynamic/Marshallers.h:88
+  static bool hasCorrectValue(const VariantValue &Value) {
+    return Value.getMatcher().hasTypedMatcher<T>();
   }
----------------
sammccall wrote:
> If the matcher type is incorrect e.g. `hasValueType(cxxRecordDecl())` I think 
> this report "value not found: cxxRecordDecl()" or something like that - 
> really this is a type error.
> 
> This is minor and probably not worse than "matcher != matcher" today.
> 
> But for ideal error messages we might want to give the traits more 
> responsibility for the structure of their error conditions (e.g. changing 
> get() to return Expected<T>)
That's a good idea for a future change!


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

https://reviews.llvm.org/D85611

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

Reply via email to