[cfe-dev] clang++: std::is_aggregate unusable with clang-5.0/libstdc++-7

Katsuhiko Nishimra via cfe-dev cfe-dev at lists.llvm.org
Fri Jul 7 00:23:46 PDT 2017


Dear developers,

As of r307243, clang++ seems to have the __is_aggregate() builtin
macro, but __has_builtin(__is_aggregate) returns false.  This is
rendering std::is_aggregate from libstdc++-7 unusable with clang++.

I have tested the code below with clang-5.0=5.0~svn307243-1 package from
apt.llvm.org on a debian unstable box.

#include <iostream>

int main(void){
	std::cout << "__has_builtin(__is_aggregate) = " <<  __has_builtin(__is_aggregate) << std::endl;
	std::cout << "__is_aggregate(int[42]) = " <<  __is_aggregate(int[42]) << std::endl;
	std::cout << "__is_aggregate(std::string) = " <<  __is_aggregate(std::string) << std::endl;
	return 0;
}

result: 
__has_builtin(__is_aggregate) = 0
__is_aggregate(int[42]) = 1
__is_aggregate(std::string) = 0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170707/6521b1e1/attachment.sig>


More information about the cfe-dev mailing list