cxx-trailing-return.cpp 558 B

1234567891011121314151617
  1. // RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t-cxx11
  2. // RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t-cxx11 -verify %s
  3. #ifndef HEADER_INCLUDED
  4. #define HEADER_INCLUDED
  5. typedef auto f() -> int;
  6. typedef int g();
  7. #else
  8. typedef void f; // expected-error {{typedef redefinition with different types ('void' vs 'auto () -> int')}}
  9. // expected-note@7 {{here}}
  10. typedef void g; // expected-error {{typedef redefinition with different types ('void' vs 'int ()')}}
  11. // expected-note@8 {{here}}
  12. #endif