summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx-using-directive.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.Kaelyn Uhrain2013-10-191-2/+2
| | | | | | | | | | | Now that CorrectTypo knows how to correctly search classes for typo correction candidates, there is no good reason to only replace an existing CXXScopeSpecifier if it refers to a namespace. While the actual enablement was a matter of changing a single comparison, the fallout from enabling the functionality required a lot more code changes (including my two previous commits). llvm-svn: 193020
* Allow typo correction to try removing nested name specifiers.Kaelyn Uhrain2013-07-021-2/+2
| | | | | | | | | | | | | | | | | 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. llvm-svn: 185487
* Add the global namespace (the "::" namespace specifier) to the list ofKaelyn Uhrain2013-06-241-2/+3
| | | | | | namespaces to try for potential typo corrections. llvm-svn: 184762
* Allow CorrectTypo to add/modify nested name qualifiers to typos thatKaelyn Uhrain2012-06-061-2/+3
| | | | | | | | | are otherwise too short to try to correct. The TODOs added to two of the tests are for existing deficiencies in the typo correction code that could be exposed by using longer identifiers. llvm-svn: 158109
* Improve typo correction involving nested name specifiers.Kaelyn Uhrain2012-02-151-4/+2
| | | | | | | | | | | | Snooping in other namespaces when the identifier being corrected is already qualified (i.e. a valid CXXScopeSpec is passed to CorrectTypo) and ranking synthesized namespace qualifiers relative to the existing qualifier is now performed. Support for disambiguating the string representation of synthesized namespace qualifers has also been added (the change to test/Parser/cxx-using-directive.cpp is an example of an ambiguous relative qualifier). llvm-svn: 150622
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Parsing and AST support for using declarations, from John Thompson!Douglas Gregor2009-06-201-2/+1
| | | | llvm-svn: 73812
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Clean up some error messages with anonymous structs/unions and member ↵Douglas Gregor2009-03-061-1/+1
| | | | | | declaration parsing. Fixes PR3680 llvm-svn: 66305
* Introduce code modification hints into the diagnostics system. When weDouglas Gregor2009-02-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | know how to recover from an error, we can attach a hint to the diagnostic that states how to modify the code, which can be one of: - Insert some new code (a text string) at a particular source location - Remove the code within a given range - Replace the code within a given range with some new code (a text string) Right now, we use these hints to annotate diagnostic information. For example, if one uses the '>>' in a template argument in C++98, as in this code: template<int I> class B { }; B<1000 >> 2> *b1; we'll warn that the behavior will change in C++0x. The fix is to insert parenthese, so we use code insertion annotations to illustrate where the parentheses go: test.cpp:10:10: warning: use of right-shift operator ('>>') in template argument will require parentheses in C++0x B<1000 >> 2> *b1; ^ ( ) Use of these annotations is partially implemented for HTML diagnostics, but it's not (yet) producing valid HTML, which may be related to PR2386, so it has been #if 0'd out. In this future, we could consider hooking this mechanism up to the rewriter to actually try to fix these problems during compilation (or, after a compilation whose only errors have fixes). For now, however, I suggest that we use these code modification hints whenever we can, so that we get better diagnostics now and will have better coverage when we find better ways to use this information. This also fixes PR3410 by placing the complaint about missing tokens just after the previous token (rather than at the location of the next token). llvm-svn: 65570
* Refactor name lookup.Douglas Gregor2009-01-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change refactors and cleans up our handling of name lookup with LookupDecl. There are several aspects to this refactoring: - The criteria for name lookup is now encapsulated into the class LookupCriteria, which replaces the hideous set of boolean values that LookupDecl currently has. - The results of name lookup are returned in a new class LookupResult, which can lazily build OverloadedFunctionDecls for overloaded function sets (and, eventually, eliminate the need to allocate member for OverloadedFunctionDecls) and contains a placeholder for handling ambiguous name lookup (for C++). - The primary entry points for name lookup are now LookupName (for unqualified name lookup) and LookupQualifiedName (for qualified name lookup). There is also a convenience function LookupParsedName that handles qualified/unqualified name lookup when given a scope specifier. Together, these routines are meant to gradually replace the kludgy LookupDecl, but this won't happen until after we have base class lookup (which forces us to cope with ambiguities). - Documented the heck out of name lookup. Experimenting a little with using Doxygen's member groups to make some sense of the Sema class. Feedback welcome! - Fixes some lingering issues with name lookup for nested-name-specifiers, which now goes through LookupName/LookupQualifiedName. llvm-svn: 62245
* - Various comment typo fixes in Sema.hChris Lattner2009-01-061-1/+2
| | | | | | | | | - Simplify ParseDeclCXX to use early exit on error instead of nesting. - Change ParseDeclCXX to using the 'skip on error' form of ExpectAndConsume. - If we don't see the ; in a using directive, still call the action, for hopefully better error recovery. llvm-svn: 61801
* Parser support for C++ using directives, from Piotr RakDouglas Gregor2008-12-301-0/+32
llvm-svn: 61486
OpenPOWER on IntegriCloud