128bitfloat.cpp 911 B

123456789101112131415161718192021222324
  1. // RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s
  2. // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
  3. #if !defined(__STRICT_ANSI__)
  4. __float128 f; // expected-error {{support for type '__float128' is not yet implemented}}
  5. // But this should work:
  6. template<typename> struct __is_floating_point_helper {};
  7. template<> struct __is_floating_point_helper<__float128> {};
  8. // FIXME: This could have a better diag.
  9. void g(int x, __float128 *y) {
  10. x + *y; // expected-error {{invalid operands to binary expression ('int' and '__float128')}}
  11. }
  12. #else
  13. __float128 f; // expected-error {{unknown type name '__float128'}}
  14. template<typename> struct __is_floating_point_helper {};
  15. template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{use of undeclared identifier '__float128'}}
  16. void g(int x, __float128 *y) { // expected-error {{unknown type name '__float128'}}
  17. x + *y;
  18. }
  19. #endif