Skip to content

Commit ee03bbc

Browse files
authored
Merge pull request #1837 from clan/autoconf
configure.ac: fix call of AC_LANG_PROGRAM & unexpected compilation er…
2 parents a903686 + f0205e2 commit ee03bbc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

configure.ac

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,16 @@ AC_LANG_PUSH([C++])
334334
# Can we use operator delete without exception handling specifier? (clang warns on this!)
335335
CXXFLAGS="-Werror"
336336
AC_MSG_CHECKING([whether CXX supports operator delete without exception handling specifier])
337-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <new>\nvoid operator delete(void* mem);])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); UT_DELETE_MUST_HAVE_EXCEPTION_SPECIFIER="yes"])
337+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <new>
338+
void operator delete(void* mem);]])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); UT_DELETE_MUST_HAVE_EXCEPTION_SPECIFIER="yes"])
338339
CXXFLAGS="$saved_cxxflags"
339340

340341
# Can we use operator new with exception specifier (g++4.7 on MacOSX is broken here)
341342
CXXFLAGS="-Werror"
342343
AC_MSG_CHECKING([whether CXX supports operator new with exception handling specifier])
343-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <new>\nvoid* operator new(size_t size) throw(std::bad_alloc);;])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); UT_NEW_CANT_HAVE_EXCEPTION_SPECIFIER="yes"])
344+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cstdint>
345+
#include <new>
346+
void* operator new(std::size_t size) throw(std::bad_alloc);;]])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); UT_NEW_CANT_HAVE_EXCEPTION_SPECIFIER="yes"])
344347
CXXFLAGS="$saved_cxxflags"
345348

346349
# Flag -Wno-missing-exception-spec

0 commit comments

Comments
 (0)