Does the Uno GCC compiler support type traits intrinsics?

I'm trying to implement the missing bits of the standard C++ library that I need for template programming. My journey has begun at implementing std::tuple, but it requires a lot of stuff from type_traits. Some of that stuff is just template magic, but some other stuff requires compiler intrinsics. I'm currently stuck at is_union:

  template<typename _Tp>
    struct is_union
    : public integral_constant<bool, __is_union(_Tp)>
  { };

As you can see, it's implemented as a wrapper around __is_union, a compiler intrinsic: a compiler-specific way to directly ask the compiler what we need to know. And, of course, this fails to compile for Uno because the compiler doesn't understand the __is_union symbol.

Question: is it supposed to work? Can I make it work? Do I need to enable compiler intrinsics by a special compiler key, or by including some header, or... ?

The compiler is based on GCC 4.9.2, which is surprisingly fresh:

 C:\Program Files (x86)\Arduino\hardware\tools\avr\bin> ./avr-g++ --version
avr-g++.exe (GCC) 4.9.2

P. S. The type traits intrinsics are documented here: https://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html

It certainly looks like it is supposed to support this. I can't imagine why this would be avr-specific.

When I try to compile your snippet, I get errors that look unrelated to __is_union() itself, but I don't know enough about this to tell whether that means anything, or is just because it's only a snippet...

You would get an error from my snippet because std::integral_constant is not a part of the default AVR stdlib implementation either.

Hmm, indeed, __is_union() is compiled no problem in an empty .ino file. I must have something else wrong in the project where I'm testing this. Thanks!

typedef union
{
  uint8_t yo;
  uint8_t lo;
} whatsthis;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(250000);
  Serial.println(__is_union(whatsthis));
  Serial.println(__is_union(uint8_t));
}

void loop() {
  // put your main code here, to run repeatedly:

}

This compiles just fine, though I can't verify if the output is correct right now. Must be something else. If you post what you have I can try to be a second pair of eyes for you.