summaryrefslogtreecommitdiffstats
path: root/clang/test/FixIt/typo-crash.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [c++20] Implement P0846R0: allow (ADL-only) calls to template-ids whoseRichard Smith2019-05-091-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | template name is not visible to unqualified lookup. In order to support this without a severe degradation in our ability to diagnose typos in template names, this change significantly restructures the way we handle template-id-shaped syntax for which lookup of the template name finds nothing. Instead of eagerly diagnosing an undeclared template name, we now form a placeholder template-name representing a name that is known to not find any templates. When the parser sees such a name, it attempts to disambiguate whether we have a less-than comparison or a template-id. Any diagnostics or typo-correction for the name are delayed until its point of use. The upshot should be a small improvement of our diagostic quality overall: we now take more syntactic context into account when trying to resolve an undeclared identifier on the left hand side of a '<'. In fact, this works well enough that the backwards-compatible portion (for an undeclared identifier rather than a lookup that finds functions but no function templates) is enabled in all language modes. llvm-svn: 360308
* Implement [class.friend]p11's special name lookup rules for friend declarationsRichard Smith2013-08-091-1/+1
| | | | | | | | of local classes. We were previously handling this by performing qualified lookup within a function declaration(!!); replace it with the proper scope lookup. llvm-svn: 188050
* Look for corrections in enclosing namespaces that require a global ↵Kaelyn Uhrain2013-07-021-2/+3
| | | | | | | | | | | | | | NestedNameSpecifier. CorrectTypo will now see and consider those corrections that are effectively shadowed by other declarations in a closer context when resolved via an unqualified lookup. This involves adding any parent namespaces to the set of namespaces as fully-qualified name specifiers, and also adding potential corrections that passed name lookup but were rejected by the given CorrectionCandidateCallback into the set of failed corrections that should be tried with the set of namespace specifiers. llvm-svn: 185486
* Replace the workaround from r153445 with a proper fix.Kaelyn Uhrain2012-04-031-2/+2
| | | | | | | | | | | | | Infinite recursion was happening when DiagnoseInvalidRedeclaration called ActOnFunctionDeclarator to check if a typo correction works when the correction was just to the nested-name-specifier because the wrong DeclContext was being passed in. Unlike a number of functions surrounding typo correction, the DeclContext passed in for a function is the context of the function name after applying any nested name specifiers, not the lexical DeclContext where the function+nested-name-specifier appears. llvm-svn: 153962
* When diagnosing an invalid out-of-line redeclaration, don't permitDouglas Gregor2012-03-261-0/+17
| | | | | | | typo correction to introduce a nested-name-specifier; we aren't prepared to handle it here. Fixes PR12297 / <rdar://problem/11075219>. llvm-svn: 153445
* Catch placeholder types in DefaultLvalueConversionJohn McCall2011-10-111-2/+2
| | | | | | | | | | | and DefaultFunctionArrayLvalueConversion. To prevent significant regression for should-this-be-a-call fixits, and to repair some such regression from the introduction of bound member placeholders, make those placeholder checks try to build calls appropriately. Harden the build-a-call logic while we're at it. llvm-svn: 141738
* Improve overloaded function handling in the typo correction code.Kaelyn Uhrain2011-08-031-5/+6
| | | | | | | | Change TypoCorrection to store a set of NamedDecls instead of a single NamedDecl. Also add initial support for performing function overload resolution to Sema::DiagnoseEmptyLookup. llvm-svn: 136807
* Add a hackaround to avoid the crash in PR10355. However, our recoveryDouglas Gregor2011-07-141-0/+11
is still terrible here because typo correction is not behaving well in the presence of overloaded functions. llvm-svn: 135128
OpenPOWER on IntegriCloud