[cfe-commits] r109697 - in /cfe/trunk: include/clang/AST/Expr.h test/CodeGenCXX/dependent-type-member-pointer.cpp
Eli Friedman
eli.friedman at gmail.com
Wed Jul 28 16:26:18 PDT 2010
Author: efriedma
Date: Wed Jul 28 18:26:18 2010
New Revision: 109697
URL: http://llvm.org/viewvc/llvm-project?rev=109697&view=rev
Log:
PR7736: Make sure to mark &Class::Member correctly as being type-dependent
inside a template class.
Added:
cfe/trunk/test/CodeGenCXX/dependent-type-member-pointer.cpp
Modified:
cfe/trunk/include/clang/AST/Expr.h
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=109697&r1=109696&r2=109697&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Wed Jul 28 18:26:18 2010
@@ -1030,7 +1030,8 @@
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) {}
Added: cfe/trunk/test/CodeGenCXX/dependent-type-member-pointer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dependent-type-member-pointer.cpp?rev=109697&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/dependent-type-member-pointer.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/dependent-type-member-pointer.cpp Wed Jul 28 18:26:18 2010
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm-only -verify %s
+// PR7736
+
+template <class scriptmemberptr> int InitMember(scriptmemberptr);
+
+template <class>
+struct contentmap
+{
+ static void InitDataMap()
+ { InitMember(&contentmap::SizeHolder); }
+ int SizeHolder;
+};
+
+void ReadFrom( )
+{
+ contentmap<int>::InitDataMap();
+}
+
More information about the cfe-commits
mailing list