[llvm-bugs] [Bug 32052] New: Should have __has_feature for GCC-compatible __auto_type
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Feb 23 18:06:49 PST 2017
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: unassignedclangbugs at nondot.org
Reporter: m-llvm at bodyfour.com
CC: llvm-bugs at lists.llvm.org
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170224/8813f186/attachment.html>
More information about the llvm-bugs
mailing list