Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attribute to support inline namespaces in C++/CLI. #781

Merged
merged 3 commits into from
Jan 30, 2020
Merged

Add attribute to support inline namespaces in C++/CLI. #781

merged 3 commits into from
Jan 30, 2020

Conversation

tgani-msft
Copy link
Contributor

A new assembly-scope custom attribute

[CppInlineNamespace(string dottedName)]

has been added to implement inline namespaces in C++/CLI. For every
inline namespace encountered in a translation unit, the C++ compiler
will emit this attribute with the fully scoped name, in CLR dotted
form, as the argument for the attribute.

A new assembly-scope custom attribute

[CppInlineNamespace(string dottedName)]

has been added to implement inline namespaces in C++/CLI. For every
inline namespace encountered in a translation unit, the C++ compiler
will emit this attribute with the fully scoped name, in CLR dotted
form, as the argument for the attribute.
@jkoritzinsky
Copy link
Member

cc: @terrajobst

@terrajobst
Copy link
Member

@tgani-msft @jkoritzinsky

Please file an issue with the proposed API plus some more explanation. Also, it would help to see some C++ sample code to understand what inline namespace is.

@tgani-msft
Copy link
Contributor Author

Filed #783

@tgani-msft
Copy link
Contributor Author

@jkoritzinsky looks like I have to add the attribute class in a reference assembly as well? Where?

@terrajobst
Copy link
Member

Filed #783

Thanks. I've added some questions there.

@tgani-msft
Copy link
Contributor Author

@jkoritzinsky I would appreciate help getting this through. I mis-remembered that this had been merged but this is blocked due to failures like this:

.packages\microsoft.dotnet.apicompat\5.0.0-beta.19608.1\build\Microsoft.DotNet.ApiCompat.targets(143,5): error : TypesMustExist : Type 'System.Runtime.CompilerServices.CppInlineNamespaceAttribute' does not exist in the reference but it does exist in the implementation.

Where/how does this need to be fixed? Thanks.

@jkoritzinsky
Copy link
Member

You'll need to also add a definition of the type in src\libraries\System.Runtime.CompilerServices.VisualC\src\System\Runtime\CompilerServices\Attributes.cs

@tgani-msft
Copy link
Contributor Author

@jkoritzinsky I already have that change (actually the only change I have in this PR). I think it also needs to be duplicated somewhere else. I would have assumed that the refs were generated automatically?

@jkoritzinsky
Copy link
Member

Sorry swap the last src in that path with ref. That’s the file you need to edit.

@tgani-msft
Copy link
Contributor Author

Yes, thanks.

@dnfclas
Copy link

dnfclas commented Jan 29, 2020

CLA assistant check
All CLA requirements met.

@jkoritzinsky jkoritzinsky merged commit cef57de into dotnet:master Jan 30, 2020
@tgani-msft tgani-msft deleted the tgani-msft/cpp-inline-namespace branch January 30, 2020 19:20
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants