[cfe-commits] r65471 - in /cfe/trunk: include/clang/Lex/Token.h test/SemaTemplate/class-template-spec.cpp

Douglas Gregor dgregor at apple.com
Wed Feb 25 11:48:02 PST 2009


Author: dgregor
Date: Wed Feb 25 13:48:02 2009
New Revision: 65471

URL: http://llvm.org/viewvc/llvm-project?rev=65471&view=rev
Log:
Include the appropriate header for malloc

Modified:
    cfe/trunk/include/clang/Lex/Token.h
    cfe/trunk/test/SemaTemplate/class-template-spec.cpp

Modified: cfe/trunk/include/clang/Lex/Token.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Token.h?rev=65471&r1=65470&r2=65471&view=diff

==============================================================================
--- cfe/trunk/include/clang/Lex/Token.h (original)
+++ cfe/trunk/include/clang/Lex/Token.h Wed Feb 25 13:48:02 2009
@@ -17,6 +17,7 @@
 #include "clang/Basic/TemplateKinds.h"
 #include "clang/Basic/TokenKinds.h"
 #include "clang/Basic/SourceLocation.h"
+#include <cstdlib>
 
 namespace clang {
 
@@ -295,10 +296,10 @@
 
   static TemplateIdAnnotation* Allocate(unsigned NumArgs) {
     TemplateIdAnnotation *TemplateId 
-      = (TemplateIdAnnotation *)malloc(sizeof(TemplateIdAnnotation) + 
-                                       sizeof(void*) * NumArgs + 
-                                       sizeof(SourceLocation) * NumArgs +
-                                       sizeof(bool) * NumArgs);
+      = (TemplateIdAnnotation *)std::malloc(sizeof(TemplateIdAnnotation) + 
+                                            sizeof(void*) * NumArgs + 
+                                            sizeof(SourceLocation) * NumArgs +
+                                            sizeof(bool) * NumArgs);
     TemplateId->NumArgs = NumArgs;
     return TemplateId;
   }

Modified: cfe/trunk/test/SemaTemplate/class-template-spec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/class-template-spec.cpp?rev=65471&r1=65470&r2=65471&view=diff

==============================================================================
--- cfe/trunk/test/SemaTemplate/class-template-spec.cpp (original)
+++ cfe/trunk/test/SemaTemplate/class-template-spec.cpp Wed Feb 25 13:48:02 2009
@@ -41,4 +41,5 @@
   x2->bar(); // okay: refers to #2
 }
 
-// FIXME: diagnose specializations in a different namespace
+// Diagnose specializations in a different namespace
+class A<double> { };





More information about the cfe-commits mailing list