[llvm-bugs] [Bug 43908] New: constexpr and __declspec(property(...))) don't work together

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 5 06:58:52 PST 2019


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

            Bug ID: 43908
           Summary: constexpr and __declspec(property(...))) don't work
                    together
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jeroen.dobbelaere at synopsys.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 22773
  --> https://bugs.llvm.org/attachment.cgi?id=22773&action=edit
testcase showing the problem

clang's support of __declspec(property(...)) does not work well with constexpr.
(with or without -std=c++17)

The attached example triggers following error in clang:

  <source>:24:28: error: constexpr variable 'tmp' must be initialized by a
constant expression
    constexpr unsigned tmp = gFoo.real; // Works in MSVC19.22 but not in
clang-9
                             ^~~~~~~~~
  1 error generated.

MSVC v19.22 works as expected.

(Also see https://www.godbolt.org/z/ltXqZA )

-- 
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/20191105/62a21b68/attachment.html>


More information about the llvm-bugs mailing list