From 22cb80399f7059312ddf14be127c13fac3977ed9 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Mon, 4 Jun 2012 08:50:13 -0700 Subject: [PATCH] Issue error if user tries to declare a method. --- type.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/type.cpp b/type.cpp index ea61109d..e4cf6cc4 100644 --- a/type.cpp +++ b/type.cpp @@ -1817,7 +1817,12 @@ StructType::StructType(const std::string &n, const llvm::SmallVectorerrorCount > 0); return; } - elementTypes.push_back(type->LLVMType(g->ctx)); + else if (CastType(type) != NULL) { + Error(elementPositions[i], "Method declarations are not " + "supported."); + } + else + elementTypes.push_back(type->LLVMType(g->ctx)); } if (lStructTypeMap.find(mname) == lStructTypeMap.end()) {