Commit Graph

10 Commits

Author SHA1 Message Date
Douglas Gregor 7c84229db6 When checking a using declaration, make sure that the context we're
looking in is complete. Fixes PR8756.

llvm-svn: 122323
2010-12-21 07:41:49 +00:00
John McCall 9b72f89f0f Diagnose attempst to template using declarations and using directives.
Recover from the latter and fail early for the former.  Fixes PR8022.

llvm-svn: 118669
2010-11-10 02:40:36 +00:00
John McCall 8fe6808de0 Handle redeclarations found by ADL deterministically and reasonably.
This solution relies on an O(n) scan of redeclarations, which means it might
scale poorly in crazy cases with tons of redeclarations brought in by a ton
of distinct associated namespaces.  I believe that avoiding this
is not worth the common-case cost.

llvm-svn: 94530
2010-01-26 07:16:45 +00:00
John McCall 91f61fc921 Allow ADL to find functions imported by using decls. Leave wordy comment
about interaction between ADL and default arguments.  Shrug shoulders, commit.

llvm-svn: 94524
2010-01-26 06:04:06 +00:00
Chandler Carruth c25c6ee3db Handle using declarations in overloaded and template functions during ADL and
address resolution. This fixes PR5751.

Also, while we're here, remove logic from ADL which mistakenly included the
definition namespaces of overloaded and/or templated functions whose name or
address is used as an argument.

llvm-svn: 92245
2009-12-29 06:17:27 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- 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
2009-12-15 20:14:24 +00:00
Anders Carlsson f9812782b7 In CXXRecordDecl::forallBases, add the base to the "queue", so we walk more than one heirarchy of classes. John, please review.
llvm-svn: 90948
2009-12-09 04:26:02 +00:00
Douglas Gregor 54fdb417fe When adding the underlying declaration of a decl to a lookup-results
set, expand overloaded function declarations. Long-term, this should
actually be done by the name-lookup code rather than here, but this
part of the code (involving using declarations) is getting a makeover
now and the test-case is useful.

llvm-svn: 88846
2009-11-15 08:11:13 +00:00
Douglas Gregor 505ad49a09 Teach Sema::isDeclInScope to handle overload sets constructed from
functions that occur in multiple declaration contexts, e.g., because
some were found via using declarations. Now, isDeclInScope will build
a new overload set (when needed) containing only those declarations
that are actually in scope. This eliminates a problem found with
libstdc++'s <iostream>, where the presence of using 

In the longer term, I'd like to eliminate Sema::isDeclInScope in favor
of better handling of the RedeclarationOnly flag in the name-lookup
routines. That way, name lookup only returns the entities that matter,
rather than taking the current two-pass approach of producing too many
results and then filtering our the wrong results. It's not efficient,
and I'm sure that we aren't filtering everywhere we should be.

llvm-svn: 82954
2009-09-28 00:47:05 +00:00
Anders Carlsson 5f212cbb73 Fix another assert related to using decls.
llvm-svn: 74262
2009-06-26 03:54:13 +00:00