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

Error: unknown type name 'FMT_NO_UNIQUE_ADDRESS' #3492

Closed
KellanClark opened this issue Jun 15, 2023 · 2 comments
Closed

Error: unknown type name 'FMT_NO_UNIQUE_ADDRESS' #3492

KellanClark opened this issue Jun 15, 2023 · 2 comments

Comments

@KellanClark
Copy link

KellanClark commented Jun 15, 2023

I noticed recently that fmt was causing errors and preventing my project from compiling. The stream of errors is very long, but they all stem from

[build] In file included from C:/Users/Kellan/CLionProjects/ortin/modules/fmt/src/os.cc:13:
[build] In file included from C:/Users/Kellan/CLionProjects/ortin/modules/fmt/include\fmt/os.h:20:
[build] C:/Users/Kellan/CLionProjects/ortin/modules/fmt/include\fmt/format.h:935:3: error: unknown type name 'FMT_NO_UNIQUE_ADDRESS'
[build]   FMT_NO_UNIQUE_ADDRESS Allocator alloc_;
[build]   ^
[build] C:/Users/Kellan/CLionProjects/ortin/modules/fmt/include\fmt/format.h:935:25: warning: declaration of 'Allocator' shadows template parameter [-Wmicrosoft-template-shadow]
[build]   FMT_NO_UNIQUE_ADDRESS Allocator alloc_;
[build]                         ^
[build] C:/Users/Kellan/CLionProjects/ortin/modules/fmt/include\fmt/format.h:929:20: note: template parameter is declared here
[build]           typename Allocator = std::allocator<T>>
[build]                    ^

I bisected and found #3485 was the culprit. There's a couple confusing things about this error.

  1. FMT_NO_UNIQUE_ADDRESS should be defined. It's further up in the file and my IDE shows it should expand to [[no_unique_address]] in my environment. For some reason, it's not getting replaced by the preprocessor.
  2. I can't replicate this in Godbolt. It may be that I'm using the GNU command line version of Clang 15.0.1 installed by Visual Studio (not clang-cl, the clang.exe installed with it), which isn't an option.
phprus added a commit to phprus/fmt that referenced this issue Jun 15, 2023
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
@phprus
Copy link
Contributor

phprus commented Jun 15, 2023

@KellanClark
Test PR #3493 please.

@KellanClark
Copy link
Author

Your PR fixes it. Thanks!

vitaut pushed a commit that referenced this issue Jun 16, 2023
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants