aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-25 19:48:02 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-25 19:48:02 +0000
commitac1afdc58e6ad5c969f45fd2ff6d140d3b4dd862 (patch)
treedda08693ea1f153289b3b6ab13b71ea18ba50405
parenta985b31fc36aa22859983b4a5e7385796c627bdc (diff)
Include the appropriate header for malloc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65471 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Lex/Token.h9
-rw-r--r--test/SemaTemplate/class-template-spec.cpp3
2 files changed, 7 insertions, 5 deletions
diff --git a/include/clang/Lex/Token.h b/include/clang/Lex/Token.h
index 5bbb63add9..2c8f2ad3f2 100644
--- a/include/clang/Lex/Token.h
+++ b/include/clang/Lex/Token.h
@@ -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;
}
diff --git a/test/SemaTemplate/class-template-spec.cpp b/test/SemaTemplate/class-template-spec.cpp
index 86cd52c3e3..4de220a77c 100644
--- a/test/SemaTemplate/class-template-spec.cpp
+++ b/test/SemaTemplate/class-template-spec.cpp
@@ -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> { };