Граф коммитов

33 Коммитов

Автор SHA1 Сообщение Дата
John McCall 7002f4c03c Turn access control on by default in -cc1.
Remove -faccess-control from -cc1; add -fno-access-control.
Make the driver pass -fno-access-control by default.
Update a bunch of tests to be correct under access control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 19:03:51 +00:00
Douglas Gregor 06245bfb3a Improve handling of friend types in several ways:
- When instantiating a friend type template, perform semantic
  analysis on the resulting type.
  - Downgrade the errors concerning friend type declarations that do
  not refer to classes to ExtWarns in C++98/03. C++0x allows
  practically any type to be befriended, and ignores the friend
  declaration if the type is not a class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 17:57:12 +00:00
John McCall 73061d0541 Pretty-print anonymous types using their kind and presumed location.
Fixes PR6643.  Patch by Mike M!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98946 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 07:56:44 +00:00
John McCall 7c2342dd4c When pretty-printing tag types, only print the tag if we're in C (and
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).

Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 11:27:22 +00:00
Chandler Carruth 8761d680ea Make Decl::isOutOfLine() virtual, and use that to determine when definitions
are for out of line declarations more easily. This simplifies the logic and
handles the case of out-of-line class definitions correctly. Fixes PR6107.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96729 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 07:08:09 +00:00
John McCall 6b2accb479 Improve access control diagnostics. Perform access control on member-pointer
conversions.  Fix an access-control bug where privileges were not considered
at intermediate points along the inheritance path.  Prepare for friends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95775 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 09:31:12 +00:00
Eli Friedman cfdc81a834 Initialization improvements: addition of string initialization and a few
small bug fixes in SemaInit, switch over SemaDecl to use it more often, and
change a bunch of diagnostics which are different with the new initialization
code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91767 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 08:11:05 +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
John McCall 2f841ba3b3 Stop trying to analyze class-hierarchies for dependently-scoped id-expressions;
there's nothing interesting we can say now that we're correctly not requiring
the qualifier to name a known base class in dependent contexts.

Require scope specifiers on member access expressions to name complete types
if they're not dependent;  delay lookup when they are dependent.

Use more appropriate diagnostics when qualified implicit member access
expressions find declarations from unrelated classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90289 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 03:53:29 +00:00
Sebastian Redl 38fd4d0011 Make sure we actually have a definition before asking if it is implicit. Fixes PR4674.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 22:31:45 +00:00
Douglas Gregor a786fdbf6c Improve diagnostics when the parser encounters a declarator with an
unknown type name, e.g.,

  foo::bar x;

when "bar" does not refer to a type in "foo". 

With this change, the parser now calls into the action to perform
diagnostics and can try to recover by substituting in an appropriate
type. For example, this allows us to easily diagnose some missing
"typename" specifiers, which we now do:

  test/SemaCXX/unknown-type-name.cpp:29:1: error: missing 'typename'
        prior to dependent type name 'A<T>::type'
  A<T>::type A<T>::f() { return type(); }
  ^~~~~~~~~~
  typename 

Fixes PR3990.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 23:27:22 +00:00
Douglas Gregor d85bea2aff Rework the Parse-Sema interaction for friends to better support friend
class templates. We now treat friend class templates much more like
normal class templates, except that they still get special name lookup
rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in
<iostream>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 06:47:28 +00:00
John McCall 53489322f6 When adding a friend class declaration to the lookup tables, use the access specifier
of any previous declaration in case we replace it in a class's declaration table.
Fixes bug 4858.  This sort of thing makes me reconsider putting friend declarations in
declaration lists.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80750 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 02:15:17 +00:00
John McCall d7eff68dbb Ensure that the tag decls of friend decls aren't added to the friending class's
decl list, and remove some workarounds that were due to this.  Thanks to Eli for
pointing this out and providing the test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 00:55:30 +00:00
John McCall ab88d97734 Fix bug 4784 and allow friend declarations to properly extend
existing declaration chains.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 22:39:49 +00:00
John McCall 02cace78cf Omnibus friend decl refactoring. Instead of cloning AST classes for friend
declarations of same, introduce a single AST class and add appropriate bits
(encoded in the namespace) for whether a decl is "real" or not.  Much hackery
about previously-declared / not-previously-declared, but it's essentially
mandated by the standard that friends alter lookup, and this is at least
fairly non-intrusive.

Refactor the Sema methods specific to friends for cleaner flow and less nesting.

Incidentally solve a few bugs, but I remain confident that we can put them back.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 07:59:38 +00:00
John McCall 91cf4199cc Modify an assert to capture the restriction on friend declarations more
accurately.  Prevents the assert from triggering incorrectly when friending 
functions first declared in extern "C" contexts.  Fixes bug 4757.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:53:59 +00:00
John McCall 7f27d92006 Permit a class to friend its members in C++0x, without restriction.
Permit a class to friend its class members in C++ 98, as long as extensions
are enabled (and even when they aren't, only give an extwarn about it).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78332 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 20:49:32 +00:00
John McCall 67d1a67f3d First pass at friend semantics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 02:15:43 +00:00
John McCall 213a60edb7 AlisdairM pointed out that this will likely be relaxed in C++0x, so let's
make a note of it in the test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 00:50:46 +00:00
John McCall e9472787be Add a test for invalid uses of non-static members from nested classes, just
because I was thinking about it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 23:56:26 +00:00
Owen Anderson bc0a2226c7 Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 21:00:51 +00:00
Daniel Dunbar 8bf0ccd4c7 Make having no RUN line a failure.
Doug, please look at decltype-crash and instantiate-function-1.mm, I'm not sure
if they are actually testing the right thing / anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 12:47:38 +00:00
Mike Stump 3ef84e1575 Prep for new warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76772 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 20:02:03 +00:00
Douglas Gregor 1f2023ab8b "This patch implements the restrictions on union members detailed in
[class.union]p1", from John McCall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 18:25:24 +00:00
Mike Stump 8e82210709 Revert this, we have a better way to do this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:47:12 +00:00
Mike Stump f18de03d21 Revert this, we have a better way to handle this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:45:39 +00:00
Mike Stump f0a6a0c29f Prep for new warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 19:03:43 +00:00
Mike Stump 8d36222f50 Prep for new warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 19:02:55 +00:00
Anders Carlsson 9ca97ba45c Add test for [class.local]p2.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-24 02:00:28 +00:00
Anders Carlsson 3aa518b5ff Add test for [class.nested.type]p1
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74033 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-24 00:30:37 +00:00
Anders Carlsson e98da2e7af Support for [class.local]p4.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74030 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-24 00:28:53 +00:00
Anders Carlsson e41590d250 [class.local] p1 and p3. Also, add back the xcodeproj file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-24 00:10:43 +00:00