clang doesn't seem to like __declspec in typedefs, so declare the class first using the macro expanding into __declspec and don't use it in the typedef later. Closes #18196.