Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions clang/lib/AST/ExprClassification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,13 @@ static Cl::Kinds ClassifyMemberExpr(ASTContext &Ctx, const MemberExpr *E) {
static Cl::Kinds ClassifyBinaryOp(ASTContext &Ctx, const BinaryOperator *E) {
assert(Ctx.getLangOpts().CPlusPlus &&
"This is only relevant for C++.");

// For binary operators which are unknown due to type dependence, the
// convention is to classify them as a prvalue. This does not matter much, but
// it needs to agree with how they are created.
if (E->getType() == Ctx.DependentTy)
return Cl::CL_PRValue;

// C++ [expr.ass]p1: All [...] return an lvalue referring to the left operand.
// Except we override this for writes to ObjC properties.
if (E->isAssignmentOp())
Expand Down
6 changes: 6 additions & 0 deletions clang/test/SemaTemplate/temp_arg_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ namespace CheckDependentNonTypeParamTypes {
};
// FIXME: This should be rejected, as there are no valid instantiations for E<char>::F
template struct E<char>;

#if __cplusplus >= 201703L
template<template<auto> class TT, class V> struct G {
using type = TT<((void)0, V::value)>;
};
#endif
}

namespace PR32185 {
Expand Down