Skip to content

C++/CLI compile error C3611 for "gcnew System::Windows::Forms::DataObject" #9644

Closed

Description

@panxn

.NET version

.NET8 preview6

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

It works in .NET6&7

Issue description

I'm not sure if it belongs to winform, maybe it's a bug of c++/cli compiler since these code compile well if rewrite with C#.

To reproduce the error, just create a new project in VS, add following attributes in vcxproj:

  <PropertyGroup>
    <TargetFramework>net8.0-windows</TargetFramework>
    <CLRSupport>NetCore</CLRSupport>
  </PropertyGroup>
  <ItemGroup>
    <FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" />
  </ItemGroup>

Compile following code, then we can see compile error C3611: a sealed function cannot have a pure-specifier

void HelloWorld()
{
    gcnew System::Windows::Forms::DataObject();
}

BTW I suspect it's a c++/cli compiler bug because I have encountered it in dotnet/runtime#88840 (comment), this comment also provides another sample. Please help forward this problem to right person if you treat it as a compiler bug. Thanks!

Steps to reproduce

see description

Activity

  1. added
    untriaged
    on Aug 3, 2023
  2. elachlan commented on Aug 8, 2023

    @elachlan
    Contributor

    @Tanya-Solyanik is this the right repo for this?

  3. merriemcgaw commented on Aug 8, 2023

    @merriemcgaw
    Contributor

    This should go to the C++ team. @Olina-Zhang can you please file a bug in AzDO under the C++ area path and close this when you're done?

  4. removed
    untriaged
    on Aug 8, 2023
  5. Olina-Zhang commented on Aug 9, 2023

    @Olina-Zhang
    Member
  6. ghost locked as resolved and limited conversation to collaborators on Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions