EricWF added inline comments.

Comment at: include/clang/AST/ComparisonCategories.h:77-78
+  ///   comparison category. For example 'std::strong_equality::equal'
+  const DeclRefExpr *getResultValue(ComparisonCategoryResult ValueKind) const {
+    const DeclRefExpr *DR = getResultValueUnsafe(ValueKind);
+    assert(DR &&
rsmith wrote:
> EricWF wrote:
> > rsmith wrote:
> > > This should deal in `DeclRefExpr*`s, not `NamedDecl*`s. We don't have an 
> > > expression naming the comparison result value, and we shouldn't pretend 
> > > we do.
> > I'm confused. This does deal in `DeclRefExpr*`s. I'm probably being daft. 
> > Could you clarify?
> Sorry, while editing this comment I managed to reverse it from what I meant. 
> This should deal in NamedDecl* (or perhaps ValueDecl*) , not DeclRefExpr*.
OK, so I tried changing this to `VarDecl` but it made the `ExprConstant` and 
`GCExprAgg` implementations a lot harder, since we actually want to evaluate 
the result as a `DeclRefExpr` as we're not evaluating the actual `Decl`. 

Since we don't want to be building dummy `DeclRefExpr`s during evaluation just 
to throw them away, I think it makes sense to eagerly build the results as 

Does that make sense?

cfe-commits mailing list

Reply via email to