]> granicus.if.org Git - clang/commit
Instantiation of a CXXMethodDecl may fail when the parameter type cannot be instantia...
authorNick Lewycky <nicholas@mxc.ca>
Fri, 2 Jan 2015 01:33:12 +0000 (01:33 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Fri, 2 Jan 2015 01:33:12 +0000 (01:33 +0000)
commitdd03a2db436ea1c99993bada326ee0fe570cf6d8
tree9ee6cfd37407ccfc0137e03ca245f54d13d3450f
parent2e98270d45c3201e0ad684a798d217a9d0bfb258
Instantiation of a CXXMethodDecl may fail when the parameter type cannot be instantiated. Do not crash in this case. Fixes PR22040!

The FIXME in the test is caused by TemplateDeclInstantiator::VisitCXXRecordDecl
returning a nullptr instead of creating an invalid decl. This is a common
pattern across all of TemplateDeclInstantiator, so I'm not comfortable changing
it. The reason it's not invalid in the class template is due to support for an
MSVC extension, see r137573.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225071 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/SemaTemplate/instantiate-method.cpp