This is an archive of the discontinued LLVM Phabricator instance.

Support GNU extension StmtExpr in constexpr function
Needs ReviewPublic

Authored by sberg on Jul 18 2017, 7:47 AM.

Details

Reviewers
rsmith
Summary

The assert.h in glibc 2.25 defines assert as a GNU-extension "statement expression", see https://sourceware.org/git/?p=glibc.git;a=commit;h=e077349ce589466eecd47213db4fae6b80ec18c4 "assert.h: allow gcc to detect assert(a = 1) errors". That caused Clang's -std=gnu++14 to no longer treat constexpr functions containing assert as actually being constant expressions. (And I ran into that when trying to build LibreOffice master with Clang trunk against Fedora 26 glibc.)

Diff Detail

Event Timeline

sberg created this revision.Jul 18 2017, 7:47 AM
sberg updated this revision to Diff 111632.Aug 18 2017, 1:55 AM

(the original diff had inadvertently lacked full -U999999 context; uploaded a new diff)