annotate clang/test/SemaTemplate/alias-template-nondependent.cpp @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 2e18cbf3894f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 // RUN: %clang_cc1 -std=c++20 -verify %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 namespace PR46377 {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 template<typename> using IntPtr = int*;
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 template<typename ...T> auto non_dependent_typedef() {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 typedef int(*P)(IntPtr<T>...);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 return P();
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 template<typename ...T> auto non_dependent_alias() {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 using P = int(*)(IntPtr<T>...);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 return P();
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 template<typename ...T> auto non_dependent_via_sizeof() {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 using P = int(*)(int(...pack)[sizeof(sizeof(T))]); // expected-error {{invalid application of 'sizeof'}}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 return P();
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 using a = int (*)(int*, int*);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 using a = decltype(non_dependent_typedef<void, void>());
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 using a = decltype(non_dependent_alias<void, void>());
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 using a = decltype(non_dependent_via_sizeof<float, float>());
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 using b = decltype(non_dependent_via_sizeof<float, void>()); // expected-note {{instantiation of}}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 }