hokein added a comment.

> Not trying to be difficult, but I'm not sure what you mean by "dependent" in 
> #2. Informally, it means the same thing as #1. Formally, C++ defines 
> type-dependence and value-dependence for expressions, and the ABI defines 
> instantiation-dependence for expressions - AFAIK "dependent" doesn't have a 
> formal meaning.
> 
> So I'd rather say it has two definitions:
> 
> informally, it (somehow) depends on a template parameter.
>  formally (from the C++ABI), an expression is instantiation-dependent if it 
> is type-dependent or value-dependent, or it has a subexpression that is 
> type-dependent or value-dependent.
>  To preserve the linkage between these two, IMO we need to extend the formal 
> definition to errors if and only if we extend the informal definition to 
> errors. Accidentally unlinking the two is almost certain to result in subtle 
> bugs as either the implementation subtly differs from the spec, or it subtly 
> differs from the mental model.

agree! I think the mental model you described makes more sense. yeah, it is 
*important* to keep the linkage between the informal and formal definition. It 
also explains why we should set instantiation-bit. Thanks!

ok, we have an agreement on the current approach. The only remaining thing is 
to clarify comments in clang. I will do it here (rather than D83215 
<https://reviews.llvm.org/D83215>), so that this discussion thread can be found 
via the commit message.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83213



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

Reply via email to