[Bug c++/87494] hidden visibility constexpr variables left unevaluated

froydnj at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 4 12:32:00 GMT 2018


Nathan Froyd <froydnj at gcc dot gnu.org> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #4 from Nathan Froyd <froydnj at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #2)
> I don't think this is techincally a bug.  It might be a missed optimization
> but not a bug.  You still need a definition even for constexpr if used
> outside of a constexpr usage IIRC.

You can only use `constexpr` on variable definitions, not declarations.  So I
already have a definition, and I can't imagine where another one should be

FWIW, clang and MSVC both accept this code without problems.

More information about the Gcc-bugs mailing list