annotate clang/test/SemaTemplate/instantiation-default-2.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 template<typename T, T Value> struct Constant; // expected-note{{template parameter is declared here}} \
anatofuz
parents:
diff changeset
4 // FIXME: bad location expected-error{{a non-type template parameter cannot have type 'float'}}
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 Constant<int, 5> *c1;
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 int x;
anatofuz
parents:
diff changeset
9 float f(int, double);
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 Constant<int&, x> *c2;
anatofuz
parents:
diff changeset
12 Constant<int*, &x> *c3;
anatofuz
parents:
diff changeset
13 Constant<float (*)(int, double), f> *c4;
anatofuz
parents:
diff changeset
14 Constant<float (*)(int, double), &f> *c5;
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 Constant<float (*)(int, int), f> *c6; // expected-error{{non-type template argument of type 'float (int, double)' cannot be converted to a value of type 'float (*)(int, int)'}}
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 Constant<float, 0> *c7; // expected-note{{while substituting}}