comparison clang/test/SemaTemplate/instantiate-self.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
comparison
equal deleted inserted replaced
173:0572611fdcc8 207:2e18cbf3894f
60 } 60 }
61 61
62 namespace test6 { 62 namespace test6 {
63 template<typename T> constexpr T f(T); 63 template<typename T> constexpr T f(T);
64 template<typename T> constexpr T g(T t) { 64 template<typename T> constexpr T g(T t) {
65 typedef int arr[f(T())]; // expected-error {{variable length array}} 65 // FIXME: It'd be nice to say that the function is currently being defined, rather than being undefined.
66 typedef int arr[f(T())]; // expected-error {{variable length array}} expected-note {{undefined function 'f<int>'}}
66 return t; 67 return t;
67 } 68 }
68 template<typename T> constexpr T f(T t) { 69 template<typename T> constexpr T f(T t) { // expected-note {{declared here}}
69 typedef int arr[g(T())]; // expected-error {{zero size array}} expected-note {{instantiation of}} 70 typedef int arr[g(T())]; // expected-error {{zero size array}} expected-note {{instantiation of}}
70 return t; 71 return t;
71 } 72 }
72 int n = f(0); // expected-note 2{{instantiation of}} 73 int n = f(0); // expected-note 2{{instantiation of}}
73 } 74 }