================
@@ -788,6 +788,18 @@ static void instantiateDependentHLSLParamModifierAttr(
ParmVarDecl *NewParm = cast<ParmVarDecl>(New);
NewParm->addAttr(Attr->clone(S.getASTContext()));
+ // If this is groupshared don't change the type because it will assert
+ // below. In this case we might have already produced an error but we
+ // must produce one here again because of all the ways templates can
+ // be used.
+ if (const auto *RT = NewParm->getType()->getAs<LValueReferenceType>()) {
+ if (RT->getPointeeType().getAddressSpace() == LangAS::hlsl_groupshared) {
+ S.Diag(Attr->getLoc(), diag::err_hlsl_attr_incompatible)
+ << Attr << "'groupshared'";
----------------
spall wrote:
Maybe. I'll try that.
https://github.com/llvm/llvm-project/pull/181886
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits