| 1 |
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t |
| 2 |
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s |
| 3 |
|
| 4 |
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch -fpch-instantiate-templates %s -o %t |
| 5 |
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s |
| 6 |
|
| 7 |
#ifndef HEADER_INCLUDED |
| 8 |
|
| 9 |
#define HEADER_INCLUDED |
| 10 |
|
| 11 |
using size_t = decltype(sizeof(int)); |
| 12 |
int operator"" _foo(const char *p, size_t); |
| 13 |
|
| 14 |
template<typename T> auto f(T t) -> decltype(t + ""_foo) { return 0; } |
| 15 |
|
| 16 |
#else |
| 17 |
|
| 18 |
int j = ""_foo; |
| 19 |
int k = f(0); |
| 20 |
int *l = f(&k); |
| 21 |
struct S {}; |
| 22 |
int m = f(S()); // expected-error {{no matching}} |
| 23 |
// expected-note@14 {{substitution failure}} |
| 24 |
|
| 25 |
#endif |