[llvm-bugs] [Bug 36333] Supposedly-incorrect error 'constexpr variable... must be initialized by a constant expression'

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 26 15:08:18 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36333

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk,
                   |                            |tstellar at redhat.com

--- Comment #2 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Reduced: https://godbolt.org/g/DwtMmM

struct ObfDescriptor {
  constexpr ObfDescriptor(int n) : n(n) {}
  int n;
};

struct Arr { ObfDescriptor od[1]; };

template<int Dependent> struct obf_str_literal {
  static constexpr int sz4 = Dependent;
  constexpr static Arr split = {ObfDescriptor(sz4)};
};

This is the same as bug#36055.

(In reply to Sergey Ignatchenko from comment #0)
> NB: it MIGHT be a different manifestation of recently-fixed bug #36055, but
> if so - it would be nice to re-apply the fix back to Clang 5.0.x (which is
> still the-latest-greatest-officially-released-Clang). 

Clang 6 (in which this is fixed) will be released soon. We have historically
not done point releases for older releases after a new release is shipped.

+Tom Stellard, though, in case we do choose to release a Clang 5.0.2.

*** This bug has been marked as a duplicate of bug 36055 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180226/6214fd41/attachment.html>


More information about the llvm-bugs mailing list