Subject: [Boost-bugs] [Boost C++ Libraries] #6754: [result_of] Test fails on clang trunk and gcc-4.7
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-04-01 02:42:15
#6754: [result_of] Test fails on clang trunk and gcc-4.7
-------------------------------------+--------------------------------------
Reporter: michel | Owner: djwalker
Type: Bugs | Status: new
Milestone: To Be Determined | Component: utility
Version: Boost Development Trunk | Severity: Problem
Keywords: C++11 |
-------------------------------------+--------------------------------------
In C++11, when a function call expression `EXPR` is a prvalue of non-class
types,
`decltype(EXPR)` does not have cv-qualifiers.
This is because
* `decltype(EXPR)`is the type of `EXPR` when a function call expression
`EXPR` is a prvalue;
* a prvalue of non-class types is never cv-qualified.
So, for "`const int f();`", `decltype(f())` is `int`.
Because this rule was introduced at the last minute of the C++11
standardization process,
only a few compilers implement it for now: clang trunk (which will be
clang-3.1) and gcc-4.7.
On those compilers in a C++11 mode, the test fails with the following
errors.
1. result_of_test.cpp:210:3: error: static assertion failed:
{{{
(is_same<result_of<const
result_of_member_function_template(double)>::type, const
double>::value)
}}}
2. result_of_test.cpp:211:3: error: static assertion failed:
{{{
(is_same<result_of<volatile
result_of_member_function_template(double)>::type, volatile
double>::value)
}}}
3. result_of_test.cpp:212:3: error: static assertion failed:
{{{
(is_same<result_of<const volatile
result_of_member_function_template(double)>::type, const volatile
double>::value)
}}}
4. result_of_test.cpp:239:3: error: static assertion failed:
{{{
(is_same<result_of<const volatile
no_result_type_or_result_of(void)>::type, const unsigned
short>::value)
}}}
5. result_of_test.cpp:244:3: error: static assertion failed:
{{{
(is_same<result_of<const volatile
no_result_type_or_result_of_template<void>(void)>::type, const
unsigned short>::value)
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6754> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC