]> granicus.if.org Git - clang/commitdiff
Move the work-in-progress implementation of variadic templates to its own file in...
authorDouglas Gregor <dgregor@apple.com>
Wed, 15 Dec 2010 17:38:57 +0000 (17:38 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 15 Dec 2010 17:38:57 +0000 (17:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121869 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/CMakeLists.txt
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateVariadic.cpp [new file with mode: 0644]

index c220e90c1292108bdb69393909fb0f35f4cde513..af9c2f4c4536c2db6efc51c9ae2a7694f4bc5079 100644 (file)
@@ -33,6 +33,7 @@ add_clang_library(clangSema
   SemaTemplateDeduction.cpp
   SemaTemplateInstantiate.cpp
   SemaTemplateInstantiateDecl.cpp
+  SemaTemplateVariadic.cpp
   SemaType.cpp
   TargetAttributesSema.cpp
   )
index 088e0193a599a22fff40ba380508edd3b2385539..4b8c455731a1600f2a9d84c0a964a4e81bb9aca0 100644 (file)
@@ -5961,32 +5961,3 @@ Sema::getTemplateArgumentBindingsText(const TemplateParameterList *Params,
   return Result;
 }
 
-bool Sema::DiagnoseUnexpandedParameterPack(SourceLocation Loc, 
-                                           TypeSourceInfo *T,
-                                         UnexpandedParameterPackContext UPPC) {
-  // C++0x [temp.variadic]p5:
-  //   An appearance of a name of a parameter pack that is not expanded is 
-  //   ill-formed.
-  if (!T->getType()->containsUnexpandedParameterPack())
-    return false;
-
-  // FIXME: Provide the names and locations of the unexpanded parameter packs.
-  Diag(Loc, diag::err_unexpanded_parameter_pack)
-    << (int)UPPC << T->getTypeLoc().getSourceRange();
-  return true;
-}
-
-bool Sema::DiagnoseUnexpandedParameterPack(Expr *E,
-                                           UnexpandedParameterPackContext UPPC) {
-  // C++0x [temp.variadic]p5:
-  //   An appearance of a name of a parameter pack that is not expanded is 
-  //   ill-formed.
-  if (!E->containsUnexpandedParameterPack())
-    return false;
-
-  // FIXME: Provide the names and locations of the unexpanded parameter packs.
-  Diag(E->getSourceRange().getBegin(), diag::err_unexpanded_parameter_pack)
-    << (int)UPPC << E->getSourceRange();
-  return true;
-}
-
diff --git a/lib/Sema/SemaTemplateVariadic.cpp b/lib/Sema/SemaTemplateVariadic.cpp
new file mode 100644 (file)
index 0000000..42b868f
--- /dev/null
@@ -0,0 +1,46 @@
+//===------- SemaTemplateVariadic.cpp - C++ Variadic Templates ------------===/
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//===----------------------------------------------------------------------===/
+//
+//  This file implements semantic analysis for C++0x variadic templates.
+//===----------------------------------------------------------------------===/
+
+#include "clang/Sema/Sema.h"
+#include "clang/Sema/SemaInternal.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/TypeLoc.h"
+
+using namespace clang;
+
+bool Sema::DiagnoseUnexpandedParameterPack(SourceLocation Loc, 
+                                           TypeSourceInfo *T,
+                                         UnexpandedParameterPackContext UPPC) {
+  // C++0x [temp.variadic]p5:
+  //   An appearance of a name of a parameter pack that is not expanded is 
+  //   ill-formed.
+  if (!T->getType()->containsUnexpandedParameterPack())
+    return false;
+
+  // FIXME: Provide the names and locations of the unexpanded parameter packs.
+  Diag(Loc, diag::err_unexpanded_parameter_pack)
+    << (int)UPPC << T->getTypeLoc().getSourceRange();
+  return true;
+}
+
+bool Sema::DiagnoseUnexpandedParameterPack(Expr *E,
+                                           UnexpandedParameterPackContext UPPC) {
+  // C++0x [temp.variadic]p5:
+  //   An appearance of a name of a parameter pack that is not expanded is 
+  //   ill-formed.
+  if (!E->containsUnexpandedParameterPack())
+    return false;
+
+  // FIXME: Provide the names and locations of the unexpanded parameter packs.
+  Diag(E->getSourceRange().getBegin(), diag::err_unexpanded_parameter_pack)
+    << (int)UPPC << E->getSourceRange();
+  return true;
+}