Commit Graph

16 Commits

Author SHA1 Message Date
Richard Smith 13e4061bde When a namespace alias redeclares a using declaration, point the diagnostic at
the using declaration not at the thing it's using.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256602 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 23:42:34 +00:00
Richard Smith 25c4910963 Model NamespaceAliasDecls as having their nominated namespace as an underlying
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
2015-12-29 23:34:32 +00:00
Richard Smith c0b5b91dff PR25731: namespace alias declarations can appear at block scope; ensure that we
do scope-based lookup when looking for redeclarations of them. Add some related
missing checks for the scope-based redeclaration lookup: properly filter the
list of found declarations to match the scope, and diagnose shadowing of a
template parameter name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254663 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 23:24:04 +00:00
Richard Smith c8c799318e [modules] Make NamespaceAliasDecl redeclarable, as it should be. This fixes
merging of namespace aliases across modules and improves source fidelity.
Incidentally also fixes PR20816.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217103 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 23:11:22 +00:00
Richard Smith bf9658c3c2 Point the caret at the error for the 'expected namespace name' diagnostic in
a namespace alias declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154138 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-05 23:13:23 +00:00
Chris Lattner 6ad9ac0979 add PCH support for a bunch of C++ Decls, patch by
Andrew Sutton!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103301 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 21:43:38 +00:00
Douglas Gregor ae374759fc When declaring a namespace alias, ignore previous declarations that
aren't in scope. Fixes PR7014.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102915 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 15:37:31 +00:00
Douglas Gregor c67b03260d Compare namespaces properly when looking for redeclarations of
namespace aliases. Fixes PR6341.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 22:59:39 +00:00
John McCall 3dbd3d5c04 Support local namespace aliases and permit them to be instantiated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96335 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 06:53:13 +00:00
Daniel Dunbar a5728872c7 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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 20:14:24 +00:00
Anders Carlsson b73e75cfda Check in test for namespace aliases+using directives.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68086 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 05:47:19 +00:00
Anders Carlsson 81c85c4211 More improvements to namespace aliases. We now support everything except aliases in using directives.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67966 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28 23:53:49 +00:00
Anders Carlsson dd729fce03 Fix lookup bug
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28 23:49:35 +00:00
Anders Carlsson a1a1b30694 As Eli pointed out, it is possible that a namespace lookup is ambiguous!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67932 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28 07:51:31 +00:00
Anders Carlsson 5721c68299 Check that the alias points to a valid namespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67925 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28 06:42:02 +00:00
Anders Carlsson 8d7ba402ba Check that the namespace alias doesn't conflict with a previous declaration in this scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28 06:23:46 +00:00