Default to int32 for declarations without specified types.

(e.g. "uniform foo" == "uniform int32 foo")
This commit is contained in:
Matt Pharr
2012-02-06 12:43:03 -08:00
parent a9ed71f553
commit f939015b97

View File

@@ -113,6 +113,12 @@ DeclSpecs::DeclSpecs(const Type *t, StorageClass sc, int tq) {
const Type *
DeclSpecs::GetBaseType(SourcePos pos) const {
const Type *bt = baseType;
if (bt == NULL) {
Warning(pos, "No type specified in declaration. Assuming int32.");
bt = AtomicType::UnboundInt32;
}
if (vectorSize > 0) {
const AtomicType *atomicType = dynamic_cast<const AtomicType *>(bt);
if (atomicType == NULL) {