Question: This is my HTML:

```
<html>
<head>
<script>
function ppid() {
    var ppidtxt = document.getElementById('ppid').value;
    var newppidtxt = ppidtxt.toUpperCase();
    var ppide = document.getElementById('ppid');
    ppide.value = newppidtxt;
}
</script>
</head>
<body>
<form>
  <center><input type="text" id="ppid" class="form-control" name="ppid" placeholder="Personal Project ID" onchange="ppid();" /></center>
</form>
</body>
</html>

```

I've tried this is JSFiddle, on my local PC, pretty much everywhere but for some reason, whenever I type something in the form's text box with the id "ppid" it isn't capitalizing it. What have I done wrong?

Answer: 
`assert` works now that g++ has implemented [N3652, Relaxing constraints on constexpr functions](http://isocpp.org/files/papers/N3652.html). [This status page](https://gcc.gnu.org/projects/cxx1y.html) indicates that this has been implemented in gcc5.

`assert` also works (in constexpr functions) on the current clang compiler shipped by Apple, with `-std=c++1y`.

At this time, I see nothing in the standard that assures one that `assert` will work in constexpr functions, and such an assurance would be a welcome addition to the standard (at least by me).

**Update**

Richard Smith drew my attention to [LWG 2234](http://cplusplus.github.io/LWG/lwg-active.html#2234) submitted by Daniel Krügler which is attempting to create the assurance I refer to above.
This has been incorporated into C++17.
A refinement on Daniel Frey's answer is to use `noexcept` on the `constexpr` function to turn the runtime error into a call to `std::terminate`. Assertion failures are unrecoverable; they should halt the process immediately. Turning them into exceptions is a very bad idea.

```
#include <exception>
#include <stdexcept>

struct assert_failure
  : std::logic_error
{
    explicit assert_failure(const char *sz)
      : std::logic_error(sz)
    {}
};

constexpr bool in_range(int i, int j, int k) noexcept
{
    return (i <= j && j <= k) ? true : throw assert_failure("input not in range");
}

int main(int argc, char* argv[])
{
    constexpr bool b1 = in_range(0, 4, 5); // OK!
    constexpr bool b2 = in_range(0, 6, 5); // Compile-time error!
    bool b3 = in_range(0, 4, argc);        // May or may not terminate the process
}

```

The runtime error for me looks like:

```
terminate called after throwing an instance of 'assert_failure'
  what():  input not in range
Aborted (core dumped)

```

Hope that helps.