[llvm-bugs] [Bug 41313] New: __builtin_assume(false) should not be a constant expression

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 29 16:11:06 PDT 2019


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

            Bug ID: 41313
           Summary: __builtin_assume(false) should not be a constant
                    expression
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david at doublewise.net
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

I would expect this static_assert to fail:

static_assert((void(__builtin_assume(false)), true));


I believe this change would fit into the constexpr model better. constexpr
evaluation is required to diagnose undefined behavior, and __builtin_assume
states that if the condition is false, the behavior is undefined.

-- 
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/20190329/910c4b0f/attachment-0001.html>


More information about the llvm-bugs mailing list