================
@@ -1848,6 +1848,11 @@ def err_placeholder_expected_auto_or_decltype_auto : 
Error<
   "expected 'auto' or 'decltype(auto)' after concept name">;
 }
 
+let CategoryName = "Reflection Issue" in {
+def err_cannot_reflect_operand : Error<
+  "cannot reflect the provided operand">;
----------------
Sirraide wrote:

The problem w/ that is that in order to print it properly, we’d have to know 
what it is... which would require parsing it, but we only issue that error if 
we *can’t* parse it. So really, there isn’t anything you can do here beyond 
just printing the token, which isn’t really helpful.

The wording of this diagnostic is also not that great imo: ‘cannot reflect the 
provided operand’ makes sense if someone writes e.g. `^^4` because we just 
don’t support that yet, but if we encounter e.g. `^^]`, then that message 
doesn’t really makes sense because `]` isn’t really an ‘operand’, it’s just a 
syntax error.

I don’t really have a good idea as to how to phrase this, because e.g. 
‘expected namespace or type’ might be fine for now, but if this eventually 
turns into ‘expected namespace or type or attribute or expression’ or something 
of the sort then that’s a pretty terrible diagnostic.

Maybe ‘expected reflectable entity’ or something of that sort? I don’t quite 
remember if the standard has a term that refers to ‘anything that can be a 
reflexion’.

https://github.com/llvm/llvm-project/pull/164692
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to