Mercurial > hg > CbC > CbC_llvm
comparison clang/test/PCH/cxx11-user-defined-literals.cpp @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children | 2e18cbf3894f |
comparison
equal
deleted
inserted
replaced
147:c2174574ed3a | 150:1d019706d866 |
---|---|
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 #ifndef HEADER_INCLUDED | |
5 | |
6 #define HEADER_INCLUDED | |
7 | |
8 using size_t = decltype(sizeof(int)); | |
9 int operator"" _foo(const char *p, size_t); | |
10 | |
11 template<typename T> auto f(T t) -> decltype(t + ""_foo) { return 0; } | |
12 | |
13 #else | |
14 | |
15 int j = ""_foo; | |
16 int k = f(0); | |
17 int *l = f(&k); | |
18 struct S {}; | |
19 int m = f(S()); // expected-error {{no matching}} | |
20 // expected-note@11 {{substitution failure}} | |
21 | |
22 #endif |