Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61626 - in trunk/boost/config: . compiler
From: dgregor_at_[hidden]
Date: 2010-04-27 15:45:09


Author: dgregor
Date: 2010-04-27 15:45:08 EDT (Tue, 27 Apr 2010)
New Revision: 61626
URL: http://svn.boost.org/trac/boost/changeset/61626

Log:
Compiler configuration logic for Clang.

Added:
   trunk/boost/config/compiler/clang.hpp (contents, props changed)
Text files modified:
   trunk/boost/config/select_compiler_config.hpp | 5 +++++
   1 files changed, 5 insertions(+), 0 deletions(-)

Added: trunk/boost/config/compiler/clang.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/config/compiler/clang.hpp 2010-04-27 15:45:08 EDT (Tue, 27 Apr 2010)
@@ -0,0 +1,65 @@
+// (C) Copyright Douglas Gregor 2010
+//
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for most recent version.
+
+// Clang compiler setup.
+
+#if __has_feature(cxx_exceptions)
+#else
+# define BOOST_NO_EXCEPTIONS
+#endif
+
+#if __has_feature(cxx_rtti)
+#else
+# define BOOST_NO_RTTI
+#endif
+
+#if defined(__int32)
+// HACK: Clang only defines the type __int32 in Microsoft-compatibility mode,
+// which means that declspecs are also available
+# define BOOST_HAS_DECLSPEC
+#endif
+
+#if defined(__int64)
+# define BOOST_HAS_MS_INT64
+#endif
+
+// NOTE: Clang does not yet support NRVO.
+
+// NOTE: Clang's C++0x support is not worth detecting. However, it
+// supports both extern templates and "long long" even in C++98/03
+// mode.
+#define BOOST_NO_AUTO_DECLARATIONS
+#define BOOST_NO_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CHAR16_T
+#define BOOST_NO_CHAR32_T
+#define BOOST_NO_CONCEPTS
+#define BOOST_NO_CONSTEXPR
+#define BOOST_NO_DECLTYPE
+#define BOOST_NO_DEFAULTED_FUNCTIONS
+#define BOOST_NO_DELETED_FUNCTIONS
+#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_INITIALIZER_LISTS
+#define BOOST_NO_LAMBDAS
+#define BOOST_NO_NULLPTR
+#define BOOST_NO_RAW_LITERALS
+#define BOOST_NO_RVALUE_REFERENCES
+#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_STATIC_ASSERT
+#define BOOST_NO_TEMPLATE_ALIASES
+#define BOOST_NO_UNICODE_LITERALS
+#define BOOST_NO_VARIADIC_TEMPLATES
+
+// HACK: Clang does support extern templates, but Boost's test for
+// them is wrong.
+#define BOOST_NO_EXTERN_TEMPLATE
+
+#ifndef BOOST_COMPILER
+// NOTE: Clang does not expose a version number
+# define BOOST_COMPILER "Clang C++"
+#endif

Modified: trunk/boost/config/select_compiler_config.hpp
==============================================================================
--- trunk/boost/config/select_compiler_config.hpp (original)
+++ trunk/boost/config/select_compiler_config.hpp 2010-04-27 15:45:08 EDT (Tue, 27 Apr 2010)
@@ -15,6 +15,7 @@
 // compilers we support:
 
 # define BOOST_CXX_GCCXML 0
+# define BOOST_CXX_CLANG 0
 # define BOOST_CXX_COMO 0
 # define BOOST_CXX_DMC 0
 # define BOOST_CXX_INTEL 0
@@ -49,6 +50,10 @@
 // Comeau C++
 # define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp"
 
+#elif defined __clang__
+// Clang C++ emulates GCC, so it has to appear early.
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/clang.hpp"
+
 #elif defined __DMC__
 // Digital Mars C++
 # define BOOST_COMPILER_CONFIG "boost/config/compiler/digitalmars.hpp"


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk