brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · a7fd2a7 Raw
46 lines · cpp
1// RUN: %clang_cc1 -std=c++2a -emit-pch %s -o %t2// RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s3 4// RUN: %clang_cc1 -std=c++2a -emit-pch -fpch-instantiate-templates %s -o %t5// RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s6 7// expected-no-diagnostics8 9#ifndef HEADER10#define HEADER11 12template<typename T, typename U = char>13concept SizedLike = sizeof(T) == sizeof(U);14 15template <class T> void f(T) requires (sizeof(int) == sizeof(T)) {}16template <class T> void f(T) requires (sizeof(char) == sizeof(T)) {}17 18template <class T> requires (sizeof(int) == sizeof(T)) void g(T) {}19template <class T> requires (sizeof(char) == sizeof(T)) void g(T) {}20 21template <SizedLike<int> T> void h(T) {}22template <SizedLike<char> T> void h(T) {}23 24template <SizedLike<int> T> void i(T) {}25template <SizedLike T> void i(T) {}26 27void j(SizedLike<int> auto ...ints) {}28 29template<template<SizedLike> class P> struct S1 { };30 31#else /*included pch*/32 33int main() {34  (void)f('1');35  (void)f(1);36  (void)g('1');37  (void)g(1);38  (void)h('1');39  (void)h(1);40  (void)i('1');41  (void)i(1);42  (void)j(1, 2, 3);43}44 45#endif // HEADER46