diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/pt.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/pr97460.C | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2a9a8fa..dc664ec 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5877,7 +5877,8 @@ push_template_decl (tree decl, bool is_friend) || TREE_CODE (ctx) == FUNCTION_DECL || (CLASS_TYPE_P (ctx) && TYPE_BEING_DEFINED (ctx)) || (TREE_CODE (decl) == TYPE_DECL && LAMBDA_TYPE_P (TREE_TYPE (decl))) - || (is_friend && !DECL_TEMPLATE_INFO (decl))) + || (is_friend && !(DECL_LANG_SPECIFIC (decl) + && DECL_TEMPLATE_INFO (decl)))) { if (DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl) diff --git a/gcc/testsuite/g++.dg/template/pr97460.C b/gcc/testsuite/g++.dg/template/pr97460.C new file mode 100644 index 0000000..6dea489 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/pr97460.C @@ -0,0 +1,9 @@ +// PR 97460 +// ICE, null dereference + +class io_context { + template <int> class basic_executor_type; +}; +template <int> class io_context::basic_executor_type { + template <int> friend class basic_executor_type; +}; |