diff options
| author | Saar Raz <saar@raz.email> | 2020-03-06 18:45:12 +0200 |
|---|---|---|
| committer | Saar Raz <saar@raz.email> | 2020-03-06 19:34:43 +0200 |
| commit | 7c18c2f709e9a1009c120ff31863799a1279c3b1 (patch) | |
| tree | 3a41953975e5116e7311adb4ea68a01e9952a79d /clang/test/SemaTemplate/instantiate-abbreviated-template.cpp | |
| parent | edcd83a669b68a2d371a54dc46e647a2efe97a4f (diff) | |
| download | bcm5719-llvm-7c18c2f709e9a1009c120ff31863799a1279c3b1.tar.gz bcm5719-llvm-7c18c2f709e9a1009c120ff31863799a1279c3b1.zip | |
[Concepts] Add null check for TemplateTypeParmType::getDecl() in GetContainedInventedTypeParmVisitor
GetContainedInventedTypeParmVisitor would not account for the case where TemplateTypeParmType::getDecl() is
nullptr, causing bug #45102.
Add the nullptr check.
(cherry picked from commit 865456d589e093582acaafd17d58ad1c0cce66af)
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-abbreviated-template.cpp')
| -rw-r--r-- | clang/test/SemaTemplate/instantiate-abbreviated-template.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-abbreviated-template.cpp b/clang/test/SemaTemplate/instantiate-abbreviated-template.cpp index 99801115626..1f2171a25eb 100644 --- a/clang/test/SemaTemplate/instantiate-abbreviated-template.cpp +++ b/clang/test/SemaTemplate/instantiate-abbreviated-template.cpp @@ -31,3 +31,15 @@ struct G { using gf1 = decltype(G<int, char>::foo1('a', 1, 2, 3, 4)); // expected-error{{no matching function}} using gf2 = decltype(G<int, char>::foo2('a', 1, 2)); // expected-error{{no matching function}} + + +// Regression (bug #45102): check that instantiation works where there is no +// TemplateTypeParmDecl +template <typename T> using id = T; + +template <typename T> +constexpr void g() { + id<void (T)> f; +} + +static_assert((g<int>(), true));
\ No newline at end of file |

