summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index f2ff6b6101e..fd79935fbd9 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -623,6 +623,9 @@ Sema::OwningExprResult Sema::ActOnIdExpression(Scope *S,
UnqualifiedId &Name,
bool HasTrailingLParen,
bool IsAddressOfOperand) {
+ assert(!(IsAddressOfOperand && HasTrailingLParen) &&
+ "cannot be direct & operand and have a trailing lparen");
+
if (Name.getKind() == UnqualifiedId::IK_TemplateId) {
ASTTemplateArgsPtr TemplateArgsPtr(*this,
Name.TemplateId->getTemplateArgs(),
@@ -856,7 +859,7 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
// performance.
if (!ADL) {
bool isAbstractMemberPointer =
- (isAddressOfOperand && !HasTrailingLParen && SS && !SS->isEmpty());
+ (isAddressOfOperand && SS && !SS->isEmpty());
if (!isAbstractMemberPointer && !Lookup.empty() &&
isa<CXXRecordDecl>((*Lookup.begin())->getDeclContext())) {
OpenPOWER on IntegriCloud