-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[lld] Remove const qualifier on symbolKind (NFC) #94753
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
Conversation
The symbol including this member is being overwritten here: https://github.com/llvm/llvm-project/blob/2117677e304d334326f6591f3c75fb2f34dc4bcb/lld/COFF/SymbolTable.cpp#L496-L509
@llvm/pr-subscribers-platform-windows @llvm/pr-subscribers-lld Author: Nikita Popov (nikic) ChangesThe symbol including this member is being overwritten here: llvm-project/lld/COFF/SymbolTable.cpp Lines 496 to 509 in 2117677
const qualifier.
Full diff: https://github.com/llvm/llvm-project/pull/94753.diff 1 Files Affected:
diff --git a/lld/COFF/Symbols.h b/lld/COFF/Symbols.h
index ca69fb2d05270..5ef46f5af6a6c 100644
--- a/lld/COFF/Symbols.h
+++ b/lld/COFF/Symbols.h
@@ -106,7 +106,7 @@ class Symbol {
"If the name is empty, the Symbol must be a DefinedCOFF.");
}
- const unsigned symbolKind : 8;
+ unsigned symbolKind : 8;
unsigned isExternal : 1;
public:
|
This seems fine, but some of the subclasses still have vtables, so we're still effectively doing some kind of placement new operation here without updating the other existing Symbol references, and I think that is technically UB without more laundering operations. |
I recall this discussion @zygoloid : Is the |
The relevant rule was changed for C++20; now Regardless I think it's best to avoid |
The symbol including this member is being overwritten here:
llvm-project/lld/COFF/SymbolTable.cpp
Lines 496 to 509 in 2117677
const
qualifier.