Index: boost/config/suffix.hpp =================================================================== --- boost/config/suffix.hpp (revision 72295) +++ boost/config/suffix.hpp (working copy) @@ -359,6 +359,13 @@ #define BOOST_HAS_VARIADIC_TMPL #endif +// +// Set BOOST_NO_DECLTYPE_N3276 when BOOST_NO_DECLTYPE is defined +// +#if !defined(BOOST_NO_DECLTYPE_N3276) && defined(BOOST_NO_DECLTYPE) +#define BOOST_NO_DECLTYPE_N3276 +#endif + // BOOST_HAS_ABI_HEADERS // This macro gets set if we have headers that fix the ABI, // and prevent ODR violations when linking to external libraries: Index: boost/config/compiler/sunpro_cc.hpp =================================================================== --- boost/config/compiler/sunpro_cc.hpp (revision 72295) +++ boost/config/compiler/sunpro_cc.hpp (working copy) @@ -105,6 +105,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS Index: boost/config/compiler/gcc.hpp =================================================================== --- boost/config/compiler/gcc.hpp (revision 72295) +++ boost/config/compiler/gcc.hpp (working copy) @@ -217,6 +217,10 @@ #define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX #endif +// C++0x features not supported at all yet +// +#define BOOST_NO_DECLTYPE_N3276 + #ifndef BOOST_COMPILER # define BOOST_COMPILER "GNU C++ version " __VERSION__ #endif Index: boost/config/compiler/digitalmars.hpp =================================================================== --- boost/config/compiler/digitalmars.hpp (revision 72295) +++ boost/config/compiler/digitalmars.hpp (working copy) @@ -66,6 +66,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS Index: boost/config/compiler/metrowerks.hpp =================================================================== --- boost/config/compiler/metrowerks.hpp (revision 72295) +++ boost/config/compiler/metrowerks.hpp (working copy) @@ -98,6 +98,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS Index: boost/config/compiler/mpw.hpp =================================================================== --- boost/config/compiler/mpw.hpp (revision 72295) +++ boost/config/compiler/mpw.hpp (working copy) @@ -46,6 +46,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS Index: boost/config/compiler/pathscale.hpp =================================================================== --- boost/config/compiler/pathscale.hpp (revision 72295) +++ boost/config/compiler/pathscale.hpp (working copy) @@ -52,6 +52,7 @@ # define BOOST_NO_DELETED_FUNCTIONS # define BOOST_NO_DEFAULTED_FUNCTIONS # define BOOST_NO_DECLTYPE +# define BOOST_NO_DECLTYPE_N3276 # define BOOST_NO_CONSTEXPR # define BOOST_NO_COMPLETE_VALUE_INITIALIZATION # define BOOST_NO_CHAR32_T Index: boost/config/compiler/visualc.hpp =================================================================== --- boost/config/compiler/visualc.hpp (revision 72295) +++ boost/config/compiler/visualc.hpp (working copy) @@ -194,6 +194,7 @@ #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS Index: boost/config/compiler/common_edg.hpp =================================================================== --- boost/config/compiler/common_edg.hpp (revision 72295) +++ boost/config/compiler/common_edg.hpp (working copy) @@ -76,6 +76,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS Index: boost/config/compiler/vacpp.hpp =================================================================== --- boost/config/compiler/vacpp.hpp (revision 72295) +++ boost/config/compiler/vacpp.hpp (working copy) @@ -84,6 +84,7 @@ #else # define BOOST_HAS_DECLTYPE #endif +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS Index: boost/config/compiler/gcc_xml.hpp =================================================================== --- boost/config/compiler/gcc_xml.hpp (revision 72295) +++ boost/config/compiler/gcc_xml.hpp (working copy) @@ -31,6 +31,7 @@ # define BOOST_NO_NULLPTR # define BOOST_NO_TEMPLATE_ALIASES # define BOOST_NO_DECLTYPE +# define BOOST_NO_DECLTYPE_N3276 # define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS # define BOOST_NO_RVALUE_REFERENCES # define BOOST_NO_STATIC_ASSERT Index: boost/config/compiler/hp_acc.hpp =================================================================== --- boost/config/compiler/hp_acc.hpp (revision 72295) +++ boost/config/compiler/hp_acc.hpp (working copy) @@ -98,6 +98,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS Index: boost/config/compiler/pgi.hpp =================================================================== --- boost/config/compiler/pgi.hpp (revision 72295) +++ boost/config/compiler/pgi.hpp (working copy) @@ -53,6 +53,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS Index: boost/config/compiler/borland.hpp =================================================================== --- boost/config/compiler/borland.hpp (revision 72295) +++ boost/config/compiler/borland.hpp (working copy) @@ -172,6 +172,7 @@ #define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CONSTEXPR +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS Index: boost/config/compiler/clang.hpp =================================================================== --- boost/config/compiler/clang.hpp (revision 72295) +++ boost/config/compiler/clang.hpp (working copy) @@ -35,6 +35,7 @@ # define BOOST_NO_DECLTYPE #endif +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #if !__has_feature(cxx_deleted_functions) Index: libs/config/test/no_decltype_n3276_pass.cpp =================================================================== --- libs/config/test/no_decltype_n3276_pass.cpp (revision 0) +++ libs/config/test/no_decltype_n3276_pass.cpp (revision 0) @@ -0,0 +1,37 @@ +// This file was automatically generated on Tue May 31 13:42:03 2011 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// 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/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_DECLTYPE_N3276 +// This file should compile, if it does not then +// BOOST_NO_DECLTYPE_N3276 should be defined. +// See file boost_no_decltype_n3276.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifndef BOOST_NO_DECLTYPE_N3276 +#include "boost_no_decltype_n3276.ipp" +#else +namespace boost_no_decltype_n3276 = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_decltype_n3276::test(); +} + Property changes on: libs\config\test\no_decltype_n3276_pass.cpp ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Id Added: svn:eol-style + native Index: libs/config/test/config_test.cpp =================================================================== --- libs/config/test/config_test.cpp (revision 72295) +++ libs/config/test/config_test.cpp (working copy) @@ -1,4 +1,4 @@ -// This file was automatically generated on Mon May 09 12:11:18 2011 +// This file was automatically generated on Tue May 31 13:42:03 2011 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -197,6 +197,11 @@ #else namespace boost_no_decltype = empty_boost; #endif +#ifndef BOOST_NO_DECLTYPE_N3276 +#include "boost_no_decltype_n3276.ipp" +#else +namespace boost_no_decltype_n3276 = empty_boost; +#endif #ifndef BOOST_DEDUCED_TYPENAME #include "boost_no_ded_typename.ipp" #else @@ -1276,6 +1281,11 @@ std::cerr << "Failed test for BOOST_NO_DECLTYPE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_no_decltype_n3276::test()) + { + std::cerr << "Failed test for BOOST_NO_DECLTYPE_N3276 at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_deduced_typename::test()) { std::cerr << "Failed test for BOOST_DEDUCED_TYPENAME at: " << __FILE__ << ":" << __LINE__ << std::endl; Index: libs/config/test/config_info.cpp =================================================================== --- libs/config/test/config_info.cpp (revision 72295) +++ libs/config/test/config_info.cpp (working copy) @@ -996,6 +996,7 @@ PRINT_MACRO(BOOST_NO_CWCHAR); PRINT_MACRO(BOOST_NO_CWCTYPE); PRINT_MACRO(BOOST_NO_DECLTYPE); + PRINT_MACRO(BOOST_NO_DECLTYPE_N3276); PRINT_MACRO(BOOST_NO_DEFAULTED_FUNCTIONS); PRINT_MACRO(BOOST_NO_DELETED_FUNCTIONS); PRINT_MACRO(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS); @@ -1079,6 +1080,9 @@ + + + // END GENERATED BLOCK PRINT_MACRO(BOOST_INTEL); Index: libs/config/test/all/Jamfile.v2 =================================================================== --- libs/config/test/all/Jamfile.v2 (revision 72295) +++ libs/config/test/all/Jamfile.v2 (working copy) @@ -1,7 +1,7 @@ # # Regression test Jamfile for boost configuration setup. # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Mon May 09 12:11:18 2011 +# This file was automatically generated on Tue May 31 13:42:03 2011 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -277,6 +277,9 @@ test-suite "BOOST_NO_DECLTYPE" : [ run ../no_decltype_pass.cpp ] [ compile-fail ../no_decltype_fail.cpp ] ; +test-suite "BOOST_NO_DECLTYPE_N3276" : +[ run ../no_decltype_n3276_pass.cpp ] +[ compile-fail ../no_decltype_n3276_fail.cpp ] ; test-suite "BOOST_DEDUCED_TYPENAME" : [ run ../no_ded_typename_pass.cpp ] [ compile-fail ../no_ded_typename_fail.cpp ] ; Index: libs/config/test/boost_no_decltype_n3276.ipp =================================================================== --- libs/config/test/boost_no_decltype_n3276.ipp (revision 0) +++ libs/config/test/boost_no_decltype_n3276.ipp (revision 0) @@ -0,0 +1,148 @@ + +// (C) Copyright Eric Niebler 2011 + +// 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/libs/config for more information. + +// MACRO: BOOST_NO_DECLTYPE_N3276 +// TITLE: C++0x decltype v1.1 unavailable +// DESCRIPTION: The compiler does not support extensions to C++0x +// decltype as described in N3276 and accepted in Madrid, +// March 2011: +// + +namespace boost_no_decltype_3276 { + +// A simplified result_of implementation. +// that uses decltype. +template +struct result_of; + +template +T& declvar(); + +// use decltype +template +struct result_of +{ + typedef decltype(declvar()(declvar())) type; +}; + +template +struct result_of +{ + typedef decltype(declvar()(declvar(), declvar())) type; +}; + +// simple tuple type +template +struct tuple; + +template +struct tuple +{ + A0 a0_; + + tuple(A0 const &a0) + : a0_(a0) + {} +}; + +template +struct tuple +{ + A0 a0_; + A1 a1_; + + tuple(A0 const &a0, A1 const & a1) + : a0_(a0) + , a1_(a1) + {} +}; + +// A node in an expression tree +template // Args is a tuple. +struct Expr; + +// A function object that builds expression nodes +template +struct MakeExpr +{ + template + struct result; + + template + struct result + { + typedef Expr > type; + }; + + template + struct result + { + typedef Expr > type; + }; + + template + Expr > operator()(T const & t) const + { + return Expr >(tuple(t)); + } + + template + Expr > operator()(T const & t, U const & u) const + { + return Expr >(tuple(t, u)); + } +}; + +// Here are tag types that encode in an expression node +// what operation created the node. +struct Terminal; +struct BinaryPlus; +struct FunctionCall; + +typedef MakeExpr MakeTerminal; +typedef MakeExpr MakeBinaryPlus; +typedef MakeExpr MakeFunctionCall; + +template +struct Expr +{ + Args args_; + + explicit Expr(Args const & t) : args_(t) {} + + // An overloaded operator+ that creates a binary plus node + template + typename result_of)>::type + operator+(Expr const &right) const + { + return MakeBinaryPlus()(*this, right); + } + + // An overloaded function call operator that creates a unary + // function call node + typename result_of::type + operator()() const + { + return MakeFunctionCall()(*this); + } +}; + +int test() +{ + // This is a terminal in an expression tree + Expr > i = MakeTerminal()(42); + + i + i; // OK, this creates a binary plus node. + + i(); // OK, this creates a unary function-call node + + return 0; +} + +} Property changes on: libs\config\test\boost_no_decltype_n3276.ipp ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Id Added: svn:eol-style + native Index: libs/config/test/no_decltype_n3276_fail.cpp =================================================================== --- libs/config/test/no_decltype_n3276_fail.cpp (revision 0) +++ libs/config/test/no_decltype_n3276_fail.cpp (revision 0) @@ -0,0 +1,37 @@ +// This file was automatically generated on Tue May 31 13:42:03 2011 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// 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/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_DECLTYPE_N3276 +// This file should not compile, if it does then +// BOOST_NO_DECLTYPE_N3276 should not be defined. +// See file boost_no_decltype_n3276.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifdef BOOST_NO_DECLTYPE_N3276 +#include "boost_no_decltype_n3276.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_decltype_n3276::test(); +} + Property changes on: libs\config\test\no_decltype_n3276_fail.cpp ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Id Added: svn:eol-style + native Index: libs/config/tools/generate.cpp =================================================================== --- libs/config/tools/generate.cpp (revision 72295) +++ libs/config/tools/generate.cpp (working copy) @@ -259,13 +259,13 @@ // if(argc > 1) { - fs::path p(argv[1], fs::native); + fs::path p(argv[1]); config_path = p / "libs" / "config" / "test" ; } else { // try __FILE__: - fs::path p(__FILE__, fs::native); + fs::path p(__FILE__); config_path = p.branch_path().branch_path() / "test"; } std::cout << "Info: Boost.Config test path set as: " << config_path.string() << std::endl; Index: libs/config/doc/html/boost_config/boost_macro_reference.html =================================================================== --- libs/config/doc/html/boost_config/boost_macro_reference.html (revision 72295) +++ libs/config/doc/html/boost_config/boost_macro_reference.html (working copy) @@ -2593,8 +2593,22 @@ +

+ BOOST_NO_DECLTYPE_N3276 +

+ + +

+ The compiler does not support the extension to decltype + described in N3276, accepted in Madrid, March 2011. +

+ + + + +

BOOST_NO_DEFAULTED_FUNCTIONS