[cfe-dev] [libc++] c++14 return type deduction usage should be limited

Zhihao Yuan lichray at gmail.com
Tue Aug 13 12:03:55 PDT 2013


/usr/local/bin/clang++ -Wall -stdlib=libc++ -std=c++1y
-I/home/lichray/devel/libcxx/include a.cc
a.cc:33:10: error: cannot initialize return object of type 'typename
      std::common_type<unsigned char, unsigned char>::type' (aka
'unsigned char') with
      an rvalue of type 'auto'
                return FunctorType::operator()(t...);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:58:43: note: in instantiation of function template specialization
      'stdex::operation<std::__1::bit_xor<void>,
void>::operator()<unsigned char,
      unsigned char>' requested here
        assert(stdex::operation<std::bit_xor<>>()(a, b) == 'L');
                                                 ^
/usr/include/assert.h:54:21: note: expanded from macro 'assert'
#define assert(e)       ((e) ? (void)0 : __assert(__func__, __FILE__, \
                          ^
1 error generated.

clang++ r182968. If it's a clang bug, I have to install clang again
and try construct another test.

-- 
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/



More information about the cfe-dev mailing list