https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83271
--- Comment #4 from Alexey Salmin <alexey.salmin at gmail dot com> --- (In reply to Jonathan Wakely from comment #3) > At least there's a simple workaround (adding 'extern' to the definition > where the attribute). That's what we do, so this is really a minor bug. Still, I decided to report it for a few reasons: 1) Current g++ behavior looks inconsistent 2) clang++ and icc handle this case correctly 3) I'm used to a practice where declarations has the "extern" specifier while definitions don't. This matters when you rely on the zero-initialization which I normally don't do, but this pattern is somehow stuck in my head