UE5-MAIN build errors 'declaration of 'widget' hides class member'

‘declaration of ‘widget’ hides class member’

I’ve had this for a long time now. The last build I could successfully compile was commit 871796cd from 6-25-21 at 7:03:54 AM.

I’ll finally just post in here to get any help if possible.

EDIT: On Windows with VS 2022 (happens on VS 2019 too)

3 Likes

Same problem…

1 Like

ugly solution

#pragma warning(push)
#pragma warning(disable: 4458)

void RequestSortAttribute()
{
	SWidget* Widget = Super::GetOwnerWidget();
	ensureAlwaysMsgf(Widget, TEXT("FSlot needs to be constructed before we modify the FChildren."));
	if (Widget)
	{
		UpdateContainerSortOrder(*Widget);
	}
}

#pragma warning(pop)

in file
WidgetSlotWithAttributeSupport.h

2 Likes

Yeah same problem on VS2019 here.

Thanks @ocozzz4 that seems like a work around for now.
Surely the rest of the Epic team aren’t using this fix just to get their projects to compile :confused: hopefully they sort it out soon in the repo.

1 Like

THANK YOU omg

yeah this seems just BAD that they would go this long without actually fixing this in a way that is reflected in the code in the repo.