-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partydiverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issueextension:microsoft
Description
When using the attribute [[nodiscard]] after __declspec(dllexport), the compiler complains:
<source>(5,25): error: 'nodiscard' attribute cannot be applied to types
When swapping the [[nodiscard]] and __declspec(dllexport), the compilation succeeds.
This behavior is different from MSVC, as MSVC does not care about the order of the arguments.
Tested with
Complete example:
enum bar {
bar1 = 0
};
__declspec(dllexport) [[nodiscard]] bar foo() {
return bar::bar1;
}
int main() {
foo();
return 0;
}
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partydiverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issueextension:microsoft