From: Eli Friedman Date: Wed, 28 Jul 2010 23:26:18 +0000 (+0000) Subject: PR7736: Make sure to mark &Class::Member correctly as being type-dependent X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8a126ba9a8a2f53098d388d04ec555b758f0c67;p=clang PR7736: Make sure to mark &Class::Member correctly as being type-dependent inside a template class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109697 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index d4f953c632..ae3452bef8 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -1030,7 +1030,8 @@ public: UnaryOperator(Expr *input, Opcode opc, QualType type, SourceLocation l) : Expr(UnaryOperatorClass, type, - input->isTypeDependent() && opc != OffsetOf, + opc != OffsetOf && (input->isTypeDependent() || + type->isDependentType()), input->isValueDependent()), Val(input), Opc(opc), Loc(l) {} diff --git a/test/CodeGenCXX/dependent-type-member-pointer.cpp b/test/CodeGenCXX/dependent-type-member-pointer.cpp new file mode 100644 index 0000000000..41bb5e29d5 --- /dev/null +++ b/test/CodeGenCXX/dependent-type-member-pointer.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -emit-llvm-only -verify %s +// PR7736 + +template int InitMember(scriptmemberptr); + +template +struct contentmap +{ + static void InitDataMap() + { InitMember(&contentmap::SizeHolder); } + int SizeHolder; +}; + +void ReadFrom( ) +{ + contentmap::InitDataMap(); +} +