[clang] [clang] Bail out if the result of function template instantiation is not a function. (PR #69449)

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 18 05:59:07 PDT 2023


================
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -x c++ -std=c++14 -fsyntax-only -verify %s
+
+template <class A>
+using Type = typename A::NestedType; // expected-error {{type 'float' cannot be used prior to '::' because it has no members}}
+
+template <typename T>
+void Func() {
+  using MyType = Type<T>(); // expected-note{{in instantiation of template type alias 'Type' requested here}}
+  MyType var;
----------------
sam-mccall wrote:

// This is a function declaration, not a variable declaration!
// After substitution, we do not have a valid function type, and used to crash.

https://github.com/llvm/llvm-project/pull/69449


More information about the cfe-commits mailing list