brintos

brintos / llvm-project-archived public Read only

0
0
Text · 700 B · cf3dc8c Raw
26 lines · cpp
1// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t2// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s3 4// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch -fpch-instantiate-templates %s -o %t5// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s6 7#ifndef HEADER_INCLUDED8 9#define HEADER_INCLUDED10 11using size_t = decltype(sizeof(int));12int operator"" _foo(const char *p, size_t);13 14template<typename T> auto f(T t) -> decltype(t + ""_foo) { return 0; }15 16#else17 18int j = ""_foo;19int k = f(0);20int *l = f(&k);21struct S {};22int m = f(S()); // expected-error {{no matching}}23                // expected-note@14 {{substitution failure}}24 25#endif26