Compile errors with basic jsapi integration

[email protected] Sun, 25 Feb 2018 11:57:53 -0800 (PST)
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
I'm trying to build a basic hello world style program with JSAPI. I've copied the "boilerplate code necessary for a minimal JSAPI application" from the JSAPI User Guide (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_User_Guide) and I'm trying to build on OS X with the following command:

clang++  -std=c++11 -Iinclude -Llib  ew-test.cpp  -lmozjs-60a1 -lz -o ew-test

I'm getting a bunch of compile errors. The output up to the first error is:
In file included from ew-test.cpp:1:
In file included from include/jsapi.h:15:
In file included from include/mozilla/Range.h:12:
include/mozilla/Span.h:194:3: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
  operator=(const span_iterator<Span, IsConst>&) = default;
  ^
                                                 const
include/mozilla/Span.h:208:47: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
  MOZ_SPAN_NON_CONST_CONSTEXPR span_iterator& operator++()
                                              ^
                                                           const
include/mozilla/Span.h:215:27: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
  constexpr span_iterator operator++(int)
                          ^
                                          const
include/mozilla/Span.h:222:47: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
  MOZ_SPAN_NON_CONST_CONSTEXPR span_iterator& operator--()
                                              ^
                                                           const
include/mozilla/Span.h:229:27: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
  constexpr span_iterator operator--(int)
                          ^
                                          const
include/mozilla/Span.h:243:41: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
  MOZ_SPAN_GCC_CONSTEXPR span_iterator& operator+=(difference_type n)
                                        ^
                                                                      const
include/mozilla/Span.h:258:28: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
  constexpr span_iterator& operator-=(difference_type n)
                           ^
                                                         const
include/mozilla/Span.h:183:5: error: statement not allowed in constexpr constructor
    MOZ_RELEASE_ASSERT(span == nullptr ||
    ^
include/mozilla/Assertions.h:453:5: note: expanded from macro 'MOZ_RELEASE_ASSERT'
    MOZ_PASTE_PREFIX_AND_ARG_COUNT(MOZ_ASSERT_HELPER, __VA_ARGS__), \
    ^
include/mozilla/MacroArgs.h:76:5: note: expanded from macro 'MOZ_PASTE_PREFIX_AND_ARG_COUNT'
    MOZ_CONCAT, (aPrefix, MOZ_ARG_COUNT(__VA_ARGS__)))
    ^

I can't figure out where I'm going wrong. Any help would be appreciated.