зеркало из https://github.com/microsoft/clang.git
Fix a crash-on-invalid.
Much to everyone's surprise, the default constructor for TypeResult produces an instance with Invalid == false. This seems like a decision we may want to revisit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138601 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
410ffb2bc5
Коммит
3a51d418b2
|
@ -2131,7 +2131,7 @@ TypeResult Sema::ActOnTagTemplateIdType(TagUseKind TUK,
|
|||
|
||||
QualType Result = CheckTemplateIdType(Template, TemplateLoc, TemplateArgs);
|
||||
if (Result.isNull())
|
||||
return TypeResult();
|
||||
return TypeResult(true);
|
||||
|
||||
// Check the tag kind
|
||||
if (const RecordType *RT = Result->getAs<RecordType>()) {
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
class G {};
|
||||
template <Foo> // expected-error{{unknown type name 'Foo'}} \
|
||||
// expected-note{{template parameter is declared here}}
|
||||
class Bar {};
|
||||
|
||||
class Bar<G> blah_test; // expected-error{{template argument for non-type template parameter must be an expression}}
|
Загрузка…
Ссылка в новой задаче