A simple example will crash at IRGen:
void (^simpleBlock)() = ^ _Nonnull {
return;
};
The Return type for the block will be AttributedType of a DependentTy and it will not be resolved. We will get a crash at IRGen.
The fix is to warn when we have type attributes or qualifiers with omitted return type. The type attributes and qualifiers will be ignored.
This breaks test/SemaOpenCL/invalid-block.cl where it uses "^const(){}".
"int (^const bl3)() = ^const(){};" should emit error since we are converting between incompatible block pointer types, the block literal's return type should be void.
Instead of checking for qualifiers below, how about checking here (or, preferably, in isOmittedBlockReturnType) whether there were any present, and not treating the block as having an omitted return type if there actually is a return type present?