cxx-implicit-moves.cpp 481 B

123456789101112131415161718192021222324
  1. // Test with PCH
  2. // RUN: %clang_cc1 -std=c++11 -x c++-header -emit-pch -o %t %s
  3. // RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s
  4. // expected-no-diagnostics
  5. // PR10847
  6. #ifndef HEADER
  7. #define HEADER
  8. struct NSSize {
  9. double width;
  10. double height;
  11. };
  12. typedef struct NSSize NSSize;
  13. static inline NSSize NSMakeSize(double w, double h) {
  14. NSSize s = { w, h };
  15. return s;
  16. }
  17. #else
  18. float test(float v1, float v2) {
  19. NSSize s = NSMakeSize(v1, v2);
  20. return s.width;
  21. }
  22. #endif