-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
clang-diagnostic-error for boost include #126081
Comments
@llvm/issue-subscribers-clang-frontend Author: None (chrchr-github)
~~~c++
#include <boost/date_time/posix_time/posix_time.hpp>
~~~
After upgrading from clang19 to clang20-rc1, the line above causes this error:
This happens on Windows, but I don't see it here for some reason: https://godbolt.org/z/ooEnPzWqW |
Thanks for the report! A few questions: Do you get the same diagnostic from clang, or only from clang-tidy? Can you provide the output from |
clang and clang-tidy are both affected.
Please see the attachment. |
Thank you for this! I was able to reproduce locally, and I think this is actually a bug with boost, but I'm not yet 100% certain. A critical note was snipped from the original message (which is understandable, there's a ton of notes thanks to the instantiation stack):
which corresponds to: llvm-project/clang/docs/ReleaseNotes.rst Line 109 in c08c9f9
|
Thanks for the quick diagnosis. I have verified that the error does not occur with boost 1.80 or later (versions up to 1.79 are affected). |
I've verified, the issue is with out-of-bounds enumeration values, so closing this as not a bug. Glad to hear the issue is resolved in 1.80! |
But this also means that anyone with a dependency on boost < 1.80 will not be able to use clang20 right away. Is there a policy for this type of situation? |
Users will have to either upgrade their boost version to one which is not broken, carry local patches to boost which address the issue, or continue with Clang 19 and using llvm-project/clang/docs/ReleaseNotes.rst Line 170 in 7cbf1a2
|
This should be a reproducer: enum E { E0 };
template<E e>
struct S {};
typedef S<static_cast<E>(-1)> T; Compilation has indeed failed since clang16, and the error has merely become non-suppressible with clang20. The odd thing is, I can't see any Relevant:
|
I'm not certain I understand, here's an example of that in practice: https://godbolt.org/z/vPsrhv5Ta
Correct, that's this bit of the C++ standard: https://eel.is/c++draft/enum#dcl.enum-8
Correct, that makes an unscoped enumeration with a fixed underlying type of |
Well, if the code is rejected since clang16 unless there was |
Ah, I see, thanks! I'm not certain why you're not seeing the issue. It could be suppressed via a |
After upgrading from clang19 to clang20-rc1, the line above causes this error:
This happens on Windows, but I don't see it here for some reason: https://godbolt.org/z/ooEnPzWqW
The text was updated successfully, but these errors were encountered: