[PATCH] D33719: Add _Float16 as a C/C++ source language type

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 29 18:33:51 PDT 2017


rsmith added inline comments.


================
Comment at: lib/Sema/SemaExpr.cpp:727-728
+  // promote to double.
+  // Note that there is default argument promotion for '_Float16'; this
+  // applies to the standard floating types only.
   const BuiltinType *BTy = Ty->getAs<BuiltinType>();
----------------
Do you mean "there is no default argument promotion for '_Float16'"? I think you could be even more specific: default argument promotion applies only to `float`. (And apparently to `__half` / `__fp16`.)


================
Comment at: test/Frontend/float16.cpp:1-2
+// RUN: %clang_cc1 -std=c++11 -ast-dump %s | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -ast-dump -fnative-half-type %s | FileCheck %s --check-prefix=CHECK-NATIVE
+
----------------
If you're going to check the tree structure from an AST dump, you should turn on --strict-whitespace in FileCheck.


https://reviews.llvm.org/D33719





More information about the cfe-commits mailing list