summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/deduction-crash.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Sema] Fix an assert-on-invalid by avoiding function template specialisationAlex Lorenz2017-10-271-0/+17
| | | | | | | | | | | | | deduction for invalid functions The fabricated template parameters cause an assertion because their depth is invalid. rdar://34109988 Differential Revision: https://reviews.llvm.org/D37341 llvm-svn: 316778
* Fix assertion failure if we can't deduce a template argument for a variableRichard Smith2017-06-021-17/+19
| | | | | | | | | | | | template partial specialization. In passing, fix the deduction-crash.cpp test to actually run all the tests. Due to a typo, the last third of the file was being skipped by the parser and some of the tests were not actually testing anything as a result. Switch from FileCheck to -verify to make the problem more obvious and prevent this happening again. llvm-svn: 304604
* Improve diagnosis of unknown template name.Richard Smith2017-05-101-1/+1
| | | | | | | | | When an undeclared identifier in a context that requires a type is followed by '<', only look for type templates when typo-correcting, tweak the diagnostic text to say that a template name (not a type name) was undeclared, and parse the template arguments when recovering from the error. llvm-svn: 302732
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-041-1/+1
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
* Handle all TemplateArguments in trivial TypeLocs.Eli Friedman2013-06-261-2/+34
| | | | | | | | | | | | Armed with a much better understanding of what TemplateSpecializationTypeLoc::initializeArgLocs actually does, I now understand that it's fine to just use an empty TemplateArgumentLocInfo for Integral, Declaration, and NullPtr TemplateArguments. Fixes PR14281. (The testcases are actually derived from libcxx_test in deduction-crash.cpp because the original testcase was impossible to reduce.) llvm-svn: 185038
* Fix a regression from r164656.Eli Friedman2012-09-271-0/+11
| | | | llvm-svn: 164804
* Don't perform template argument deduction against invalid templates;Douglas Gregor2012-09-131-1/+13
| | | | | | | it's likely to lead to a crash later on. Fixes PR12933 / <rdar://problem/11525335>. llvm-svn: 163838
* Fix parsing of type-specifier-seq's. Types are syntactically allowed to beRichard Smith2012-03-121-1/+1
| | | | | | | | | | | | | | | | | | defined here, but not semantically, so new struct S {}; is always ill-formed, even if there is a struct S in scope. We also had a couple of bugs in ParseOptionalTypeSpecifier caused by it being under-loved (due to it only being used in a few places) so merge it into ParseDeclarationSpecifiers with a new DeclSpecContext. To avoid regressing, this required improving ParseDeclarationSpecifiers' diagnostics in some cases. This also required teaching ParseSpecifierQualifierList about constexpr... which incidentally fixes an issue where we'd allow the constexpr specifier in other bad places. llvm-svn: 152549
* It's considered poor form to create references to the overloadedDouglas Gregor2011-05-211-3/+33
| | | | | | | function type. Educate template argument deduction thusly, fixing PR9974 / <rdar://problem/9479155>. llvm-svn: 131811
* Extend Sema::ClassifyName() to support C++, ironing out a few issuesDouglas Gregor2011-04-271-1/+1
| | | | | | | | | in the classification of template names and using declarations. We now properly typo-correct the leading identifiers in statements to types, templates, values, etc. As an added bonus, this reduces the number of lookups required for disambiguation. llvm-svn: 130288
* Make the invalid declarator recovery when parsing members work the same as ↵Sebastian Redl2011-04-241-1/+1
| | | | | | when parsing global decls. It's still rather broken (skipping much too far when the declarator belongs to a function definition), but at least not so broken as to mismatch braces. Tested by the removal of the fixme in the template test case. llvm-svn: 130101
* Push nested-name-specifier source-location information into dependentDouglas Gregor2011-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | template specialization types. This also required some parser tweaks, since we were losing track of the nested-name-specifier's source location information in several places in the parser. Other notable changes this required: - Sema::ActOnTagTemplateIdType now type-checks and forms the appropriate type nodes (+ source-location information) for an elaborated-type-specifier ending in a template-id. Previously, we used a combination of ActOnTemplateIdType and ActOnTagTemplateIdType that resulted in an ElaboratedType wrapped around a DependentTemplateSpecializationType, which duplicated the keyword ("class", "struct", etc.) and nested-name-specifier storage. - Sema::ActOnTemplateIdType now gets a nested-name-specifier, which it places into the returned type-source location information. - Sema::ActOnDependentTag now creates types with source-location information. llvm-svn: 126808
* Improve error recovery when presented with an ill-formed template-idJohn McCall2010-07-301-1/+1
| | | | | | | | (e.g. due to a broken template argument) following template parameters. Fixes rdar://problem/8254267 llvm-svn: 109853
* When there are extra or missing template parameter lists in a templateDouglas Gregor2010-07-141-0/+59
definition, we're likely going to end up breaking the invariants of the template system, e.g., that the depths of template parameter lists match up with the nesting template of the template. So, make sure we mark such ill-formed declarations as invalid or don't even build them at all. llvm-svn: 108372
OpenPOWER on IntegriCloud