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

            Bug ID: 43990
           Summary: Incorrect error on static_assert expression
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangb...@nondot.org
          Reporter: pk...@outlook.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

Created attachment 22806
  --> https://bugs.llvm.org/attachment.cgi?id=22806&action=edit
Code to produce the issue described.

The C++11 code below produces a compilation error stating that the
static_assert expression is not an integral constant expression. GCC trunk
compiles this. Commenting-out the static assert removes the error.

template <typename T>
constexpr bool bar(T &)  { return true; }

template <typename T>
constexpr bool foo(T &x) { static_assert(bar(x),""); return bar(x); }

int main(int argc, char *argv[])
{
  int i;
  constexpr bool x = foo(i);
  return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to