[cfe-commits] r72301 - in /cfe/trunk: lib/Sema/SemaTemplateInstantiateExpr.cpp test/SemaTemplate/instantiate-function-1.cpp
Douglas Gregor
dgregor at apple.com
Fri May 22 16:25:52 PDT 2009
Author: dgregor
Date: Fri May 22 18:25:52 2009
New Revision: 72301
URL: http://llvm.org/viewvc/llvm-project?rev=72301&view=rev
Log:
Template instantiation for the GNU address-of-label extension.
Modified:
cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp
cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp?rev=72301&r1=72300&r2=72301&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateExpr.cpp Fri May 22 18:25:52 2009
@@ -55,7 +55,7 @@
OwningExprResult VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E);
OwningExprResult VisitCXXConditionDeclExpr(CXXConditionDeclExpr *E);
OwningExprResult VisitConditionalOperator(ConditionalOperator *E);
- // FIXME: AddrLabelExpr
+ OwningExprResult VisitAddrLabelExpr(AddrLabelExpr *E);
OwningExprResult VisitStmtExpr(StmtExpr *E);
OwningExprResult VisitTypesCompatibleExpr(TypesCompatibleExpr *E);
OwningExprResult VisitShuffleVectorExpr(ShuffleVectorExpr *E);
@@ -526,6 +526,13 @@
move(Cond), move(LHS), move(RHS));
}
+Sema::OwningExprResult
+TemplateExprInstantiator::VisitAddrLabelExpr(AddrLabelExpr *E) {
+ return SemaRef.ActOnAddrLabel(E->getAmpAmpLoc(),
+ E->getLabelLoc(),
+ E->getLabel()->getID());
+}
+
Sema::OwningExprResult TemplateExprInstantiator::VisitStmtExpr(StmtExpr *E) {
Sema::OwningStmtResult SubStmt
= SemaRef.InstantiateCompoundStmt(E->getSubStmt(), TemplateArgs, true);
Modified: cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp?rev=72301&r1=72300&r2=72301&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-function-1.cpp Fri May 22 18:25:52 2009
@@ -178,6 +178,14 @@
void f(T x) {
// FIXME: crummy error message below
goto *x; // expected-error{{incompatible}}
+
+ prior:
+ T prior_label = &&prior;
+
+ T later_label = &&later;
+
+ later:
+ (void)(1+1);
}
};
More information about the cfe-commits
mailing list