aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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> { };