[cfe-commits] r72145 - in /cfe/trunk: lib/Sema/SemaTemplateInstantiateExpr.cpp test/SemaTemplate/instantiate-expr-3.cpp
Douglas Gregor
dgregor at apple.com
Tue May 19 16:29:16 PDT 2009
Author: dgregor
Date: Tue May 19 18:29:16 2009
New Revision: 72145
URL: http://llvm.org/viewvc/llvm-project?rev=72145&view=rev
Log:
Add FIXMEs for the remaining C and C++ expression types that still
need template instantiation logic. Remove one FIXME by instantiating
the callee in a non-type-dependent CXXOperatorCallExpr.
Modified:
cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp
cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp?rev=72145&r1=72144&r2=72145&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp Tue May 19 18:29:16 2009
@@ -60,6 +60,12 @@
OwningExprResult VisitShuffleVectorExpr(ShuffleVectorExpr *E);
OwningExprResult VisitChooseExpr(ChooseExpr *E);
OwningExprResult VisitVAArgExpr(VAArgExpr *E);
+ // FIXME: InitListExpr
+ // FIXME: DesignatedInitExpr
+ // FIXME: ImplicitValueInitExpr
+ // FIXME: ExtVectorElementExpr
+ // FIXME: BlockExpr
+ // FIXME: BlockDeclRefExpr
OwningExprResult VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E);
OwningExprResult VisitUnresolvedDeclRefExpr(UnresolvedDeclRefExpr *E);
OwningExprResult VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E);
@@ -67,6 +73,7 @@
OwningExprResult VisitImplicitCastExpr(ImplicitCastExpr *E);
OwningExprResult VisitExplicitCastExpr(ExplicitCastExpr *E);
OwningExprResult VisitCStyleCastExpr(CStyleCastExpr *E);
+ // FIXME: CXXMemberCallExpr
OwningExprResult VisitCXXNamedCastExpr(CXXNamedCastExpr *E);
OwningExprResult VisitCXXStaticCastExpr(CXXStaticCastExpr *E);
OwningExprResult VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E);
@@ -75,6 +82,17 @@
OwningExprResult VisitCXXThisExpr(CXXThisExpr *E);
OwningExprResult VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E);
OwningExprResult VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E);
+ // FIXME: CXXTypeIdExpr
+ // FIXME: CXXThrowExpr
+ // FIXME: CXXDefaultArgExpr
+ // FIXME: CXXConstructExpr
+ // FIXME: CXXFunctionalCastExpr
+ // FIXME: CXXZeroInitValueExpr
+ // FIXME: CXXNewExpr
+ // FIXME: CXXDeleteExpr
+ // FIXME: UnaryTypeTraitExpr
+ // FIXME: QualifiedDeclRefExpr
+ // FIXME: CXXExprWithTemporaries
OwningExprResult VisitGNUNullExpr(GNUNullExpr *E);
OwningExprResult VisitUnresolvedFunctionNameExpr(
UnresolvedFunctionNameExpr *E);
@@ -324,13 +342,17 @@
// perform lookup again at instantiation time (C++ [temp.dep]p1).
// Instead, we just build the new overloaded operator call
// expression.
+ OwningExprResult Callee = Visit(E->getCallee());
+ if (Callee.isInvalid())
+ return SemaRef.ExprError();
+
First.release();
Second.release();
- // FIXME: Don't reuse the callee here. We need to instantiate it.
+
return SemaRef.Owned(new (SemaRef.Context) CXXOperatorCallExpr(
SemaRef.Context,
E->getOperator(),
- E->getCallee(),
+ Callee.takeAs<Expr>(),
Args, E->getNumArgs(),
E->getType(),
E->getOperatorLoc()));
Modified: cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp?rev=72145&r1=72144&r2=72145&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-expr-3.cpp Tue May 19 18:29:16 2009
@@ -102,7 +102,7 @@
template struct Choose0<true, int, float, float&>; // expected-note{{instantiation}}
// ---------------------------------------------------------------------
-// va_arg
+// __builtin_va_arg
// ---------------------------------------------------------------------
template<typename ArgType>
struct VaArg0 {
@@ -116,3 +116,22 @@
};
template struct VaArg0<int>;
+
+// ---------------------------------------------------------------------
+// Vector element expressions
+// ---------------------------------------------------------------------
+#if 0
+// Not supported until we have full support for MemberExpr.
+typedef __attribute__(( ext_vector_type(2) )) double double2;
+typedef __attribute__(( ext_vector_type(4) )) double double4;
+
+template<typename T, typename U>
+struct VectorElem0 {
+ void f(T t, U u) {
+ t.xy = u.zw;
+ }
+};
+
+template struct VectorElem0<double2, double4>;
+template struct VectorElem0<double4, double4>;
+#endif
More information about the cfe-commits
mailing list