Issue error if user tries to declare a method.

This commit is contained in:
Matt Pharr
2012-06-04 08:50:13 -07:00
parent 6df7d31a5b
commit 22cb80399f

View File

@@ -1817,7 +1817,12 @@ StructType::StructType(const std::string &n, const llvm::SmallVector<const Type
Assert(m->errorCount > 0);
return;
}
elementTypes.push_back(type->LLVMType(g->ctx));
else if (CastType<FunctionType>(type) != NULL) {
Error(elementPositions[i], "Method declarations are not "
"supported.");
}
else
elementTypes.push_back(type->LLVMType(g->ctx));
}
if (lStructTypeMap.find(mname) == lStructTypeMap.end()) {