[cfe-commits] r121869 - in /cfe/trunk/lib/Sema: CMakeLists.txt SemaTemplate.cpp SemaTemplateVariadic.cpp

Douglas Gregor dgregor at apple.com
Wed Dec 15 09:38:57 PST 2010


Author: dgregor
Date: Wed Dec 15 11:38:57 2010
New Revision: 121869

URL: http://llvm.org/viewvc/llvm-project?rev=121869&view=rev
Log:
Move the work-in-progress implementation of variadic templates to its own file in Sema. No functionality change.

Added:
    cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp   (with props)
Modified:
    cfe/trunk/lib/Sema/CMakeLists.txt
    cfe/trunk/lib/Sema/SemaTemplate.cpp

Modified: cfe/trunk/lib/Sema/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/CMakeLists.txt?rev=121869&r1=121868&r2=121869&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/CMakeLists.txt (original)
+++ cfe/trunk/lib/Sema/CMakeLists.txt Wed Dec 15 11:38:57 2010
@@ -33,6 +33,7 @@
   SemaTemplateDeduction.cpp
   SemaTemplateInstantiate.cpp
   SemaTemplateInstantiateDecl.cpp
+  SemaTemplateVariadic.cpp
   SemaType.cpp
   TargetAttributesSema.cpp
   )

Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=121869&r1=121868&r2=121869&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Wed Dec 15 11:38:57 2010
@@ -5961,32 +5961,3 @@
   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;
-}
-

Added: cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp?rev=121869&view=auto
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp (added)
+++ cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp Wed Dec 15 11:38:57 2010
@@ -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;
+}

Propchange: cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain





More information about the cfe-commits mailing list