summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Unrevert r186040, reverted in r186185, with fix for PR16597.Richard Smith2013-07-121-2/+9
| | | | | | | | | | | Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186199
* Revert r186040 to fix PR16597 while Richard investigates what the bestChandler Carruth2013-07-121-9/+2
| | | | | | | | | | | | | fix is. Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186185
* If we friend a declaration twice, that should not make it visible to nameRichard Smith2013-07-101-2/+9
| | | | | | | | | lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186040
* Make a couple of useful typo correction callbacks more widely available.Kaelyn Uhrain2013-07-081-0/+38
| | | | llvm-svn: 185880
* Use SmallVectorImpl instead of SmallVector for iterators and references to ↵Craig Topper2013-07-041-2/+2
| | | | | | avoid specifying the vector size unnecessarily. llvm-svn: 185610
* Allow typo correction to try removing nested name specifiers.Kaelyn Uhrain2013-07-021-2/+18
| | | | | | | | | | | | | | | | | 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
* Look for corrections in enclosing namespaces that require a global ↵Kaelyn Uhrain2013-07-021-13/+13
| | | | | | | | | | | | | | 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
* Add the global namespace (the "::" namespace specifier) to the list ofKaelyn Uhrain2013-06-241-1/+7
| | | | | | namespaces to try for potential typo corrections. llvm-svn: 184762
* Lazily provide a __float128 dummy type in -std=gnu++11 mode.Nico Weber2013-06-201-0/+8
| | | | | | This is needed to parse libstdc++ 4.7's type_traits, see PR13530. llvm-svn: 184476
* Provide operator<< for stream output of DeclarationNamesDavid Blaikie2013-05-141-1/+1
| | | | | | | | | | | ASTDumper was already trying to do this & instead got an implicit bool conversion by surprise (thus printing out 0 or 1 instead of the name of the declaration). To avoid that issue & simplify call sites, simply make it the normal/expected operator<<(raw_ostream&, ...) overload & simplify all the existing call sites. (bonus: this function doesn't need to be a member or friend, it's just using public API in DeclarationName) llvm-svn: 181832
* Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef ↵Dmitri Gribenko2013-05-051-1/+1
| | | | | | | | constructor from None Patch by Robert Wilhelm. llvm-svn: 181139
* Revert r177218.Argyrios Kyrtzidis2013-05-031-7/+0
| | | | | | Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag. llvm-svn: 181073
* Don't treat a non-deduced 'auto' type as being type-dependent. Instead, thereRichard Smith2013-04-301-0/+4
| | | | | | | | are now two distinct canonical 'AutoType's: one is the undeduced 'auto' placeholder type, and the other is a deduced-but-dependent type. All deduced-to-a-non-dependent-type cases are still non-canonical. llvm-svn: 180789
* <rdar://problem/13605348> Don't consider invalid user-defined literal ↵Douglas Gregor2013-04-101-0/+6
| | | | | | operators during overload resolution. llvm-svn: 179150
* Skip transparent contexts when looking for using directives in name lookup.Douglas Gregor2013-04-091-1/+5
| | | | | | Fixes the bootstrap regression I introduced in r179067. llvm-svn: 179079
* <rdar://problem/13540899> Collect using directives from all of the semantic ↵Douglas Gregor2013-04-081-8/+25
| | | | | | | | | | | | contexts not represented by scopes. This fixes a regression I introduced in r178136, where we would not consider the using directives from the semantic declaration contexts that aren't represented by the lexical scopes (Scope) when performing unqualified name lookup. This lead to horribly funny diagnostics like "no identifier named 'foo'; did you mean 'foo'?". llvm-svn: 179067
* Fix typo in assertion.Nick Lewycky2013-04-081-1/+1
| | | | llvm-svn: 179061
* <rdar://problem/13560075> Teach name lookup for builtin names to find hidden ↵Douglas Gregor2013-04-031-3/+12
| | | | | | | | | | | | | | declarations. Normal name lookup ignores any hidden declarations. When name lookup for builtin declarations fails, we just synthesize a new declaration at the point of use. With modules, this could lead to multiple declarations of the same builtin, if one came from a (hidden) submodule that was later made visible. Teach name lookup to always find builtin names, so we don't create these redundant declarations in the first place. llvm-svn: 178711
* Give the default CorrectionCandidateCallback::ValidateCandidate someKaelyn Uhrain2013-04-031-0/+18
| | | | | | | | smarts so that it doesn't approve of keywords and/or type names when it knows (based on its flags) that those kinds of corrections are not wanted. llvm-svn: 178668
* <rdar://problem/13317030> Consider using directives when performing ↵Douglas Gregor2013-03-271-1/+15
| | | | | | unqualified name lookup into declarations contexts represented by the qualified-id but not in the actual scope hierarchy. llvm-svn: 178136
* Remove -Wspellcheck and replace it with a diagnostic option.Argyrios Kyrtzidis2013-03-161-5/+6
| | | | | | | Thanks to Richard S. for pointing out that the warning would show up with -Weverything. llvm-svn: 177218
* Don't try to typo-correct 'super' in an objc method.Argyrios Kyrtzidis2013-03-141-0/+10
| | | | | | | | | | | | | | | | | | | | | This created 2 issues: 1) Performance issue, since typo-correction with PCH/modules is rather expensive. 2) Correctness issue, since if it managed to "correct" 'super' then bogus compiler errors would be emitted, like this: 3.m:8:3: error: unknown type name 'super'; did you mean 'super1'? super.x = 0; ^~~~~ super1 t3.m:5:13: note: 'super1' declared here typedef int super1; ^ t3.m:8:8: error: expected identifier or '(' super.x = 0; ^ llvm-svn: 177126
* ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.Jordan Rose2013-03-081-1/+1
| | | | | | No (intended) functionality change. llvm-svn: 176726
* In LookupResult::resolveKind(), when handling multiple found declarations, ↵Argyrios Kyrtzidis2013-02-221-0/+6
| | | | | | | | | ignore invalid declarations. This reduces the "ambiguous reference" errors (which are rather strange in C/ObjC) and fixes an assertion hit with an invalid code test case. llvm-svn: 175869
* Preserve Sema::UndefinedInternals across PCH boundaries. FixesNick Lewycky2013-01-261-1/+1
| | | | | | -Wundefined-internal warnings with PCH. llvm-svn: 173538
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider (sub)module visibility. The bulk of this change replaces myriad hand-rolled loops over the linked list of Objective-C categories/extensions attached to an interface declaration with loops using one of the four new category iterator kinds: visible_categories_iterator: Iterates over all visible categories and extensions, hiding any that have their "hidden" bit set. This is by far the most commonly used iterator. known_categories_iterator: Iterates over all categories and extensions, ignoring the "hidden" bit. This tends to be used for redeclaration-like traversals. visible_extensions_iterator: Iterates over all visible extensions, hiding any that have their "hidden" bit set. known_extensions_iterator: Iterates over all extensions, whether they are visible to normal name lookup or not. The effect of this change is that any uses of the visible_ iterators will respect module-import visibility. See the new tests for examples. Note that the old accessors for categories and extensions are gone; there are *Raw() forms for some of them, for those (few) areas of the compiler that have to manipulate the linked list of categories directly. This is generally discouraged. Part two of <rdar://problem/10634711>. llvm-svn: 172665
* PR14950: Fix out-of-bounds function parameter access in literal operator lookup.Richard Smith2013-01-151-1/+1
| | | | llvm-svn: 172514
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-5/+5
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-9/+9
| | | | llvm-svn: 171367
* Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as ↵David Blaikie2012-12-191-25/+28
| | | | | | | | | | | | | | | per review discussion in r170365 This does limit these typedefs to being sequences, but no current usage requires them to be contiguous (we could expand this to a more general iterator pair range concept at some point). Also, it'd be nice if SmallVector were constructible directly from an ArrayRef but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the inverse conversion. (& generalizing over all range-like things, while nice, would require some nontrivial SFINAE I haven't thought about yet) llvm-svn: 170482
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-10/+10
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Consistently use 'needsImplicit<special member>' to determine whether we needRichard Smith2012-12-011-10/+10
| | | | | | | an implicit special member, rather than sometimes using '!hasDeclared<special member>'. No functionality change. llvm-svn: 169075
* Don't return a pointer to an UnresolvedSetImpl in the CXXRecordDecl interface,Argyrios Kyrtzidis2012-11-281-3/+2
| | | | | | expose only the iterators instead. llvm-svn: 168770
* Simplify checking for whether we should implicitly declare special members andRichard Smith2012-11-271-16/+9
| | | | | | add some assertions. No functionality change. llvm-svn: 168725
* When adding a NamedDecl to a correction, add the underlying Decl (viaKaelyn Uhrain2012-11-191-1/+1
| | | | | | | | getUnderlyingDecl()) so that derivatives of CorrectionCandidateCallback::ValidateCandidate(...) don't have to worry about being thrown by UsingDecls and such. llvm-svn: 168317
* DR1442: In a range-based for statement, namespace 'std' is not an associatedRichard Smith2012-10-181-4/+1
| | | | | | namespace. llvm-svn: 166194
* Fix typo correction of one qualified name to another.David Blaikie2012-10-121-2/+6
| | | | | | | | | | | | | | When suggesting "foo::bar" as a correction for "fob::bar" we mistakenly replaced only "bar" with "foo::bar" producing "fob::foo::bar" which was broken. This corrects that replacement in as many places as I could find & provides test cases for all those cases I could find a test case for. There are a couple that don't seem to be reachable (one looks entirely dead, the other just doesn't seem to ever get called with a namespace to namespace change). Review by Richard Smith ( http://llvm-reviews.chandlerc.com/D57 ). llvm-svn: 165817
* Fix the AST representation for non-type template arguments to encodeEli Friedman2012-09-261-0/+1
| | | | | | | | | | | | enough information so we can mangle them correctly in cases involving dependent parameter types. (This specifically impacts cases involving null pointers and cases involving parameters of reference type.) Fix the mangler to use this information instead of trying to scavenge it out of the parameter declaration. <rdar://problem/12296776>. llvm-svn: 164656
* Remove Context argument from TemplateDeductionInfo constructor. It was no ↵Craig Topper2012-09-191-1/+1
| | | | | | longer needed after the unused Context member was removed in r164104. llvm-svn: 164196
* Remove RequireCompleteType call which was made redundant by r162586.Richard Smith2012-08-241-7/+0
| | | | llvm-svn: 162630
* Instantiate class template specializations during ADL.John McCall2012-08-241-7/+13
| | | | llvm-svn: 162586
* Fix PR13394: Erasing from a vector changes the end of the vector, so make ↵Benjamin Kramer2012-07-271-3/+3
| | | | | | sure we always have the right end. llvm-svn: 160855
* Fix a typo (the the => the)Sylvestre Ledru2012-07-231-2/+2
| | | | llvm-svn: 160622
* PR13381: consider cv-qualifiers on a class member's type when determining whichRichard Smith2012-07-181-4/+7
| | | | | | | constructor will be used for moving that object, in the computation of its exception specification. llvm-svn: 160417
* Add support for the C11 _Alignof keyword.Jordan Rose2012-06-301-0/+6
| | | | | | | This behaves like the existing GNU __alignof and C++11 alignof keywords; most of the patch is simply adding the third token spelling to various places. llvm-svn: 159494
* Documentation cleanup: making \param and \returns docs match the code.James Dennett2012-06-221-8/+5
| | | | llvm-svn: 158985
* Documentation cleanup: making \param docs match the code.James Dennett2012-06-221-13/+3
| | | | llvm-svn: 158982
* Documentation cleanup: escape "::", and other minor reformattingJames Dennett2012-06-191-1/+2
| | | | llvm-svn: 158741
* PR13051: Only suggest the 'template' and 'operator' keywords when performingRichard Smith2012-06-081-2/+11
| | | | | | typo-correction after a scope specifier. llvm-svn: 158231
* Allow CorrectTypo to add/modify nested name qualifiers to typos thatKaelyn Uhrain2012-06-061-3/+16
| | | | | | | | | 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
OpenPOWER on IntegriCloud