[Boost-bugs] [Boost C++ Libraries] #9511: Non-static data member

Subject: [Boost-bugs] [Boost C++ Libraries] #9511: Non-static data member
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-12-20 11:33:55


#9511: Non-static data member
------------------------------------+-------------------------
 Reporter: Bjorn Reese <breese@…> | Owner: burbelgruff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: typeof
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
------------------------------------+-------------------------
 Consider the following example:

 {{{
   void foo(int value) {}
   struct alpha {
     int value;
     typedef BOOST_TYPEOF(foo(value)) return_type;
   };
 }}}

 This example compiles just fine with g++, but with clang++ it only
 works if compiled with -std=c++11, otherwise it gives the error
 message below. I believe that clang is correct (this diagnostics was
 [https://llvm.org/viewvc/llvm-project?view=revision&revision=154073 added]
 in clang 3.1.)

 Is this a bug in Boost.Typeof or is it expected behavior? Is there a
 workaround for it?

 The error message is:

 {{{
 /home/breese/src/treediff/treediff/main.cpp:17:30: error: invalid use of
 non-static data member 'value'
     typedef BOOST_TYPEOF(foo(value)) return_type;
                              ^~~~~
 /usr/local/include/boost/typeof/native.hpp:41:76: note: expanded from
 macro 'BOOST_TYPEOF'
 #define BOOST_TYPEOF(expr)
 BOOST_TYPEOF_KEYWORD(boost::type_of::ensure_obj(expr))

     ^
 1 error generated.
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9511>
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:15 UTC