blob: 7ad17f55d7127b762566cb8e003fa5f5eaf1a840 [file] [log] [blame]
Richard Smith9fcce652012-03-07 08:35:16 +00001// 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#ifndef HEADER_INCLUDED
5
6#define HEADER_INCLUDED
7
8using size_t = decltype(sizeof(int));
9int operator"" _foo(const char *p, size_t);
10
Jordan Rose78541c42012-07-11 19:58:23 +000011template<typename T> auto f(T t) -> decltype(t + ""_foo) { return 0; }
Richard Smith9fcce652012-03-07 08:35:16 +000012
13#else
14
15int j = ""_foo;
16int k = f(0);
17int *l = f(&k);
18struct S {};
19int m = f(S()); // expected-error {{no matching}}
Jordan Rose78541c42012-07-11 19:58:23 +000020 // expected-note@11 {{substitution failure}}
Richard Smith9fcce652012-03-07 08:35:16 +000021
22#endif