https://bugs.llvm.org/show_bug.cgi?id=32052

            Bug ID: 32052
           Summary: Should have __has_feature for GCC-compatible
                    __auto_type
           Product: clang
           Version: 3.9
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

In 2015 (r252690), clang added support for GCC 4.9's "__auto_type" but as far
as I can tell there is no __has_feature() test to determine if the compiler
version you're using supports it or not.  i.e. the following compiles fine with
the latest Xcode:


#if __has_feature(__auto_type)
#error "has feature"
#endif

#if __has_extension(__auto_type)
#error "has extension"
#endif

#if __has_attribute(__auto_type)
#error "has attribute"
#endif

int main()
{
  __auto_type x = 5;
  return x;
}


Right now I don't have a source clang build handy (I am just using Xcode's
clang) but I grepped around the cfe-3.9.1 code and I couldn't find it there
either.  There is of course __has_feature(cxx_auto_type), but that's for the
C++11 "auto", not the GNU C __auto_type.  Perhaps can you add a
__has_feature(c_auto_type) or __has_feature(gnu_auto_type) in the future?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to