]> granicus.if.org Git - clang/commitdiff
Include the appropriate header for malloc
authorDouglas Gregor <dgregor@apple.com>
Wed, 25 Feb 2009 19:48:02 +0000 (19:48 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 25 Feb 2009 19:48:02 +0000 (19:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65471 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/Token.h
test/SemaTemplate/class-template-spec.cpp

index 5bbb63add9416688fcee400f56093ad201890cf1..2c8f2ad3f2b622ed876ad6063fa19a3b124d02ca 100644 (file)
@@ -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 @@ struct TemplateIdAnnotation {
 
   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;
   }
index 86cd52c3e36dbe168d5e368fa7d94e863fd64bfc..4de220a77cb58b327561e96ae3abe78f2618fce7 100644 (file)
@@ -41,4 +41,5 @@ void testme(X<int_type> *x1, X<float, int> *x2) {
   x2->bar(); // okay: refers to #2
 }
 
-// FIXME: diagnose specializations in a different namespace
+// Diagnose specializations in a different namespace
+class A<double> { };