summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCXXScopeSpec.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-1/+1
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368942 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++20] Implement P0846R0: allow (ADL-only) calls to template-ids whoseRichard Smith2019-05-091-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360308 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema][NFCI] Don't allocate storage for the various ↵Bruno Ricci2019-03-251-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CorrectionCandidateCallback unless we are going to do some typo correction The various CorrectionCandidateCallbacks are currently heap-allocated unconditionally. This was needed because of delayed typo correction. However these allocations represent currently 15.4% of all allocations (number of allocations) when parsing all of Boost (!), mostly because of ParseCastExpression, ParseStatementOrDeclarationAfterAttrtibutes and isCXXDeclarationSpecifier. Note that all of these callback objects are small. Let's not do this. Instead initially allocate the callback on the stack, and only do a heap allocation if we are going to do some typo correction. Do this by: 1. Adding a clone function to each callback, which will do a polymorphic clone of the callback. This clone function is required to be implemented by every callback (of which there is a fair amount). Make sure this is the case by making it pure virtual. 2. Use this clone function when we are going to try to correct a typo. This additionally cut the time of -fsyntax-only on all of Boost by 0.5% (not that much, but still something). No functional changes intended. Differential Revision: https://reviews.llvm.org/D58827 Reviewed By: rnk git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356925 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up and simplify RequireCompleteType.Richard Smith2018-08-071-11/+13
| | | | | | | No functional change intended, except that we will now produce more "declared here" notes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339187 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing spaceFangrui Song2018-07-301-17/+17
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338291 91177308-0d34-0410-b5e6-96231b3b80d8
* Check returned type is valid before using it.Richard Trieu2018-07-071-0/+3
| | | | | | | Add a .isNull() check to returned QualType. Fixes PR38077 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336475 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-9/+9
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for editor placeholders to ClangAlex Lorenz2017-04-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | This commit teaches Clang to recognize editor placeholders that are produced when an IDE like Xcode inserts a code-completion result that includes a placeholder. Now when the lexer sees a placeholder token, it emits an 'editor placeholder in source file' error and creates an identifier token that represents the placeholder. The parser/sema can now recognize the placeholders and can suppress the diagnostics related to the placeholders. This ensures that live issues in an IDE like Xcode won't get spurious diagnostics related to placeholders. This commit also adds a new compiler option named '-fallow-editor-placeholders' that silences the 'editor placeholder in source file' error. This is useful for an IDE like Xcode as we don't want to display those errors in live issues. rdar://31581400 Differential Revision: https://reviews.llvm.org/D32081 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300667 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Unbreak GCC -Werror build (enum compare).Davide Italiano2017-03-171-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298160 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement DR 373 "Lookup on namespace qualified name in using-directive"Matthias Gehre2017-03-171-15/+16
| | | | | | | | | | | | | | Summary: 3.4.6 [basic.lookup.udir] paragraph 1: In a using-directive or namespace-alias-definition, during the lookup for a namespace-name or for a name in a nested-name-specifier, only namespace names are considered. Reviewers: rsmith, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30848 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298126 91177308-0d34-0410-b5e6-96231b3b80d8
* PR13403 (+duplicates): implement C++ DR1310 (http://wg21.link/cwg1310).Richard Smith2017-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Under this defect resolution, the injected-class-name of a class or class template cannot be used except in very limited circumstances (when declaring a constructor, in a nested-name-specifier, in a base-specifier, or in an elaborated-type-specifier). This is apparently done to make parsing easier, but it's a pain for us since we don't know whether a template-id using the injected-class-name is valid at the point when we annotate it (we don't yet know whether the template-id will become part of an elaborated-type-specifier). As a tentative resolution to a perceived language defect, mem-initializer-ids are added to the list of exceptions here (they generally follow the same rules as base-specifiers). When the reference to the injected-class-name uses the 'typename' or 'template' keywords, we permit it to be used to name a type or template as an extension; other compilers also accept some cases in this area. There are also a couple of corner cases with dependent template names that we do not yet diagnose, but which will also get this treatment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292518 91177308-0d34-0410-b5e6-96231b3b80d8
* [ObjC++] Don't enter a C++ declarator scope when the current context isAlex Lorenz2016-12-071-0/+5
| | | | | | | | | | | | | | | | an Objective-C declaration This commit ensures that Sema won't enter a C++ declarator scope when the current context is an Objective-C declaration. This prevents an assertion failure in EnterDeclaratorContext that's used to ensure that current context will be restored correctly after exiting the declarator context. rdar://20560175 Differential Revision: https://reviews.llvm.org/D26922 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288893 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crash on invalid code.Richard Trieu2016-10-281-1/+1
| | | | | | | | | | | | | The diagnostic was attempting to access the QualType of a TypeDecl by calling TypeDecl::getTypeForDecl. However, the Type pointer stored there is lazily loaded by functions in ASTContext. In most cases, the pointer is loaded and this does not cause a problem. However, when more that 50 or so unknown types are seen beforehand, this causes the Type to not be loaded, passing a null Type to the diagnostics, leading to the crash. Using ASTContext::getTypeDeclType will give a proper QualType for all cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285370 91177308-0d34-0410-b5e6-96231b3b80d8
* Retire llvm::alignOf in favor of C++11 alignof.Benjamin Kramer2016-10-201-3/+3
| | | | | | No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284730 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass information in a record instead of stack. NFCSerge Pavlov2016-08-081-65/+54
| | | | | | | | | | Functions of Sema that work with building of nested name specifiers have too many parameters (BuildCXXNestedNameSpecifier already expects 10 arguments). With this change the information about identifier and its context is packed into a structure, which is then passes to the semantic functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277976 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Header cleanupMehdi Amini2016-07-181-2/+1
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275882 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Enforce the rules that an explicit or partial specialization must beRichard Smith2016-05-051-3/+28
| | | | | | | | | declared before it is used. Because we don't use normal name lookup to find these, the normal code to filter out non-visible names from name lookup results does not apply. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268585 91177308-0d34-0410-b5e6-96231b3b80d8
* [typo-correction] Apply name specifier corrections when forming a NNSReid Kleckner2016-02-161-0/+4
| | | | | | | | Previously we would leave behind the old name specifier prefix, which creates an invalid AST. Other callers of CorrectTypo update their CXXScopeSpec objects with the correction specifier if one is present. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260993 91177308-0d34-0410-b5e6-96231b3b80d8
* Model NamespaceAliasDecls as having their nominated namespace as an underlyingRichard Smith2015-12-291-7/+8
| | | | | | | | | | | | | | declaration. This fixes an issue where we would reject (due to a claimed ambiguity) a case where lookup finds multiple NamespaceAliasDecls from different scopes that nominate the same namespace. The C++ standard doesn't make it clear that such a case is in fact valid (which I'm working on fixing), but there are no relevant rules that distinguish using declarations and namespace alias declarations here, so it makes sense to treat them the same way. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256601 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach typo correction to properly handle mapping declarations to theirRichard Smith2015-12-291-1/+1
| | | | | | | | | | | underlying decls. Preserve the found declaration throughout, and only map to the underlying declaration when we want to check whether it's the right kind. This allows us to provide the right source location for the found declaration, and prepares for the possibility of underlying decls with a different name from the found decl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256575 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid duplicated diagnostic when lookup for a nested-name-specifier fails ↵Richard Smith2015-11-121-2/+5
| | | | | | due to ambiguity. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252967 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240353 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240270 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] If we reach a definition of a class for which we already have aRichard Smith2015-03-261-0/+1
| | | | | | | | | non-visible definition, skip the new definition and make the old one visible instead of trying to parse it again and failing horribly. C++'s ODR allows us to assume that the two definitions are identical. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233250 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle unscoped enumeration in nested name specifier.Serge Pavlov2015-01-181-8/+27
| | | | | | | | | | If an unscoped enum is used as a nested name specifier and the language dialect is not C++ 11, issue an extension warning. This fixes PR16951. Differential Revision: http://reviews.llvm.org/D6389 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226413 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a comment that appears a second time 22 lines further down.Nico Weber2014-12-301-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225004 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++1z] Support [[deprecated]] attributes on namespaces. Note that it only ↵Aaron Ballman2014-11-141-0/+4
| | | | | | applies to situations where the namespace is mentioned. Thus, use on anonymous namespaces is diagnosed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222054 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass around CorrectionCandidateCallbacks as unique_ptrs soKaelyn Takata2014-10-271-5/+4
| | | | | | TypoCorrectionConsumer can keep the callback around as long as needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220693 91177308-0d34-0410-b5e6-96231b3b80d8
* -ms-extensions: Implement __super scope specifier (PR13236).Nikola Smiljanic2014-09-261-1/+36
| | | | | | | | | We build a NestedNameSpecifier that records the CXXRecordDecl in which __super appeared. Name lookup is performed in all base classes of the recorded CXXRecordDecl. Use of __super is allowed only inside class and member function scope. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218484 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -Wunused-local-typedef, a warning that finds unused local typedefs.Nico Weber2014-09-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning warns on TypedefNameDecls -- typedefs and C++11 using aliases -- that are !isReferenced(). Since the isReferenced() bit on TypedefNameDecls wasn't used for anything before this warning it wasn't always set correctly, so this patch also adds a few missing MarkAnyDeclReferenced() calls in various places for TypedefNameDecls. This is made a bit complicated due to local typedefs possibly being used only after their local scope has closed. Consider: template <class T> void template_fun(T t) { typename T::Foo s3foo; // YYY (void)s3foo; } void template_fun_user() { struct Local { typedef int Foo; // XXX } p; template_fun(p); } Here the typedef in XXX is only used at end-of-translation unit, when YYY in template_fun() gets instantiated. To handle this, typedefs that are unused when their scope exits are added to a set of potentially unused typedefs, and that set gets checked at end-of-TU. Typedefs that are still unused at that point then get warned on. There's also serialization code for this set, so that the warning works with precompiled headers and modules. For modules, the warning is emitted when the module is built, for precompiled headers each time the header gets used. Finally, consider a function using C++14 auto return types to return a local type defined in a header: auto f() { struct S { typedef int a; }; return S(); } Here, the typedef escapes its local scope and could be used by only some translation units including the header. To not warn on this, add a RecursiveASTVisitor that marks all delcs on local types returned from auto functions as referenced. (Except if it's a function with internal linkage, or the decls are private and the local type has no friends -- in these cases, it _is_ safe to warn.) Several of the included testcases (most of the interesting ones) were provided by Richard Smith. (gcc's spelling -Wunused-local-typedefs is supported as an alias for this warning.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217298 91177308-0d34-0410-b5e6-96231b3b80d8
* Limit our MSVC compat hack for nested names from dependent basesReid Kleckner2014-08-141-2/+7
| | | | | | | | | | | | | | | | | | | | Previously, any undeclared unqualified id starting a nested name specifier in a dependent context would have its lookup retried during template instantiation. Now we limit that retry hack to methods of a class with dependent bases. Free function templates in particular are no longer affected by this hack. Also, diagnose this as a Microsoft extension. This has the downside that template authors may see this warning *and* an error during instantiation time about this identifier. Fixing that will probably require formalizing some kind of "delayed" identifier, instead of our ad-hoc solutions of forming dependent AST nodes when lookup fails. Based on a patch by Kim Gräsman! Differential Revision: http://reviews.llvm.org/D4854 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215683 91177308-0d34-0410-b5e6-96231b3b80d8
* Consolidate some note diagnosticsAlp Toker2014-05-281-6/+2
| | | | | | | | | These note diags have the same message and can be unified further but for now let's just bring them together. Incidental change: Display a source range in the final attr diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209728 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-19/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209613 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-231-1/+2
| | | | | | symbols in non-imported modules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206977 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve error recovery around colon.Serge Pavlov2014-04-131-11/+69
| | | | | | | | | | | Parse of nested name spacifier is modified so that it properly recovers if colon is mistyped as double colon in case statement. This patch fixes PR15133. Differential Revision: http://llvm-reviews.chandlerc.com/D2870 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206135 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-1/+1
| | | | | | class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203640 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve diagnostic for using non-class/namespace/scoped enum in a nested ↵David Blaikie2014-02-091-14/+17
| | | | | | | | | | | | | | | name specifier. Rather than simply saying "X is not a class or namespace", clarify what X is by providing the aka type in the case where X is a type, or pointing to the named declaration if there's an unambiguous one to refer to. In the ambiguous case, the ambiguities are already enumerated (though could be clarified by describing what kind of entities they are) Included a few FIXMEs in tests where some further improvements could be made. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201038 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename language option MicrosoftMode to MSVCCompatAlp Toker2014-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | There's been long-standing confusion over the role of these two options. This commit makes the necessary changes to differentiate them clearly, following up from r198936. MicrosoftExt (aka. fms-extensions): Enable largely unobjectionable Microsoft language extensions to ease portability. This mode, also supported by gcc, is used for building software like FreeBSD and Linux kernel extensions that share code with Windows drivers. MSVCCompat (aka. -fms-compatibility, formerly MicrosoftMode): Turn on a special mode supporting 'heinous' extensions for drop-in compatibility with the Microsoft Visual C++ product. Standards-compilant C and C++ code isn't guaranteed to work in this mode. Implies MicrosoftExt. Note that full -fms-compatibility mode is currently enabled by default on the Windows target, which may need tuning to serve as a reasonable default. See cfe-commits for the full discourse, thread 'r198497 - Move MS predefined type_info out of InitializePredefinedMacros' No change in behaviour. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199209 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Sema::BuildCXXNestedNameSpecifier correctly clear the previousKaelyn Uhrain2013-12-161-0/+2
| | | | | | | | CXXScopeSpec when necessary while performing typo correction. This fixes the crash reported in PR18213 (the problem existed since r185487, and r193020 made it easier to hit). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197409 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash if a variable template specialization is used in a ↵Richard Smith2013-12-041-3/+3
| | | | | | nested-name-specifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196335 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix several crash-on-invalids when using template-ids that aren'tRichard Smith2013-12-041-6/+7
| | | | | | | simple-template-ids (eg, 'operator+<int>') in weird places. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196333 91177308-0d34-0410-b5e6-96231b3b80d8
* Use -fms-compatibility to trigger lookup into dep. basesReid Kleckner2013-09-201-2/+2
| | | | | | | Update the docs for -fms-extensions and -fms-compatibility to try to clarify the difference between the two. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191095 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't correct typos in Sema::BuildCXXNestedNameSpecifier with -fms-extensionsKaelyn Uhrain2013-09-191-1/+1
| | | | | | | | When -fms-extensions is enabled, the typo correction was being called here on non-error paths (as in test/SemaTemplate/lookup-dependent-bases.cpp) and correct compilation depended on Sema::CorrectTypo not finding a viable candidate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191046 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor all diagnosing of TypoCorrections through a common function, inRichard Smith2013-08-171-23/+15
| | | | | | | | preparation for teaching this function how to diagnose a correction that includes importing a module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188602 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow typo correction to try removing nested name specifiers.Kaelyn Uhrain2013-07-021-3/+7
| | | | | | | | | | | | | | | | | The removal is tried by retrying the failed lookup of a correction candidate with either the MemberContext or SS (CXXScopeSpecifier) or both set to NULL if they weren't already. If the candidate identifier is then looked up successfully, make a note in the candidate that the SourceRange should include any existing nested name specifier even if the candidate isn't adding a different one (i.e. the candidate has a NULL NestedNameSpecifier). Also tweak the diagnostic messages to differentiate between a suggestion that just replaces the identifer but leaves the existing nested name specifier intact and one that replaces the entire qualified identifier, in cases where the suggested replacement is unqualified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185487 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Eli Friedman2013-06-191-10/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184379 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some no-op static_casts.Richard Smith2013-03-261-12/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177954 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'const Decl *' throughout code completion in SemaDmitri Gribenko2013-01-231-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173277 91177308-0d34-0410-b5e6-96231b3b80d8
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171367 91177308-0d34-0410-b5e6-96231b3b80d8