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

1405 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor d89d86fe4a Tighten up the semantics of default template arguments, per C++0x
[temp.param]p9 and C++ DR226. Fixes PR8747.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124856 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 04:20:44 +00:00
Argyrios Kyrtzidis 799ef66668 Implement -Woverloaded-virtual.
The difference with gcc is that it warns if you overload virtual methods only if
the method doesn't also override any method. This is to cut down on the number of warnings
and make it more useful like reported here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20423.
If we want to warn that not all overloads are overriden we can have an additional
warning like -Wpartial-override.

-Woverloaded-virtual, unlike gcc, is added to -Wmost. Addresses rdar://8757630.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124805 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 18:01:15 +00:00
John McCall cde5a400db The code trying to assign a typedef to an anonymous tag declaration was
extremely rambunctious, both on parsing and on template instantiation.
Calm it down, fixing an internal consistency assert on anonymous enum
instantiation manglings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124653 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 08:20:08 +00:00
Argyrios Kyrtzidis 36eb5e43bc Don't warn that variables in C++ static member functions shadow fields. Fixes rdar://8900456.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124581 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31 07:04:54 +00:00
Argyrios Kyrtzidis 49a6172798 Fix the diagnostic when we are shadowing an external variable and there exists a locally scoped extern with the same name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124580 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31 07:04:50 +00:00
Argyrios Kyrtzidis 6684d85e90 Diagnose if extern local variable is followed by non-extern and vice-versa.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124579 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31 07:04:46 +00:00
Argyrios Kyrtzidis 6df96e0756 'extern' variables in functions don't shadow externs in global scope. Fixes rdar://8883302.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124578 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31 07:04:41 +00:00
Douglas Gregor 83f51722ed Rvalue references for *this: parse ref-qualifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124276 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 03:43:54 +00:00
Douglas Gregor 5505c72695 Disallow function template partial specializations, from Hans
Wennborg! Fixes PR8295.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124135 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-24 18:54:39 +00:00
Anders Carlsson cb88a1f968 Use attributes for all the override control specifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124122 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-24 16:26:15 +00:00
Anders Carlsson 15e14a2895 Get rid of [[hiding]], [[override]] and [[base_check]].
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124087 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 21:33:18 +00:00
Ted Kremenek 9577abc63f Null initialize a few variables flagged by
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124072 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 17:04:59 +00:00
Anders Carlsson dfc2f1035d Mark classes as final or explicit. Diagnose when a class marked 'final' is used as a base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124039 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-22 17:51:53 +00:00
Anders Carlsson f1602a56f8 A member function template cannot be virtual.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124031 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-22 14:43:56 +00:00
Peter Collingbourne c80e811527 Sema: process non-inheritable attributes on function declarations early
This allows us to simplify the handling for the overloadable attribute,
removing a number of FIXMEs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123961 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21 02:08:54 +00:00
Peter Collingbourne a97d70b7ea Generalise support for non-inheritable attributes
Inheritable attributes on declarations may be inherited by any later
redeclaration at merge time.  By contrast, a non-inheritable attribute
will not be inherited by later redeclarations.  Non-inheritable
attributes may be semantically analysed early, allowing them to
influence the redeclaration/overloading process.

Before this change, the "overloadable" attribute received special
handling to be treated as non-inheritable, while all other attributes
were treated as inheritable.  This patch generalises the concept,
while removing a FIXME.  Some CUDA location attributes are also marked
as non-inheritable in order to support special overloading semantics
(to be introduced in a later patch).

The patch introduces a new Attr subclass, InheritableAttr, from
which all inheritable attributes derive.  Non-inheritable attributes
simply derive from Attr.

N.B. I did not review every attribute to determine whether it should
be marked non-inheritable.  This can be done later on an incremental
basis, as this change does not affect default functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21 02:08:36 +00:00
Anders Carlsson 2e1c730167 Diagnose when a virtual member function marked final is overridden.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123916 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 16:25:36 +00:00
Anders Carlsson 9e682d9f56 Diagnose virtual member functions marked override but not overriding any virtual member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123888 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 05:57:14 +00:00
Rafael Espindola 706df2fb3f Fix PR8884 by skipping transparent contexts. The test is for LikageSpec. I
failed to find a case where an enum context would make a difference, but
found PR9007 on the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123871 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 02:26:24 +00:00
John McCall 2998d6b0e6 When building the copy expression for a __block variable, make sure
there's a respectable point of instantiation.  Also, make sure we do
this operation even when instantiating a dependently-typed variable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123818 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-19 11:48:09 +00:00
John McCall f4c7371fb1 Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123814 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-19 06:33:43 +00:00
Abramo Bagnara 2b57aefea7 Added warning about invalid register specification for local variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123236 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 15:16:52 +00:00
Douglas Gregor 603cfb4da2 Initial implementation of function parameter packs. This implementation allows:
1) Declaration of function parameter packs
  2) Instantiation of function parameter packs within function types.
  3) Template argument deduction of function parameter packs when
  matching two function types.

We're missing all of the important template-instantiation logic for
function template definitions, along with template argument deduction
from the argument list of a function call, so don't even think of
trying to use these for real yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-05 23:12:31 +00:00
Argyrios Kyrtzidis 0fe5397b26 When in code-completion, skip obj-c method bodies for speed up.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122781 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 22:33:06 +00:00
Chandler Carruth ef9d09c469 Fix PR8841 by checking for both semantic and lecical dependent
contexts. This prevents -Wunused-function from firing on friend function
definitions inside of class templates for example.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122763 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 19:27:19 +00:00
Douglas Gregor 6b9109e9d5 When we attempt to create a built-in that involves a library type we
don't have access to (e.g., fprintf, which needs the library type
FILE), fail with a warning and forget about the builtin
entirely. Previously, we would actually provide an error, which breaks
autoconf's super-lame checks for fprintf, longjmp, etc. Fixes PR8316.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122744 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 09:37:44 +00:00
Rafael Espindola baf86955a9 Produce a better error message for invalid register names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122670 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 21:47:03 +00:00
John McCall 7f040a9d81 Refactor how we collect attributes during parsing, and add slots for attributes
on array and function declarators.  This is pretty far from complete, and I'll
revisit it later if someone doesn't beat me to it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 02:08:15 +00:00
Douglas Gregor a8bc8c9e9b Implement parsing of function parameter packs and non-type template
parameter packs (C++0x [dcl.fct]p13), including disambiguation between
unnamed function parameter packs and varargs (C++0x [dcl.fct]p14) for
cases like 

  void f(T...)

where T may or may not contain unexpanded parameter packs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122520 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 22:44:42 +00:00
Jeffrey Yasskin c6ed729f66 Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.  Fix one bug found by the warning, in which one
clang::OverloadCandidate constructor failed to initialize its
FunctionTemplate member.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 01:01:28 +00:00
Douglas Gregor b68e39930d In C++, if the user redeclares a builtin function with a type that is
inconsistent with the type that the builtin *should* have, forget
about the builtin altogether: we don't want subsequence analyses,
CodeGen, etc., to think that we have a proper builtin function.

C is protected from errors here because it allows one to use a
library builtin without having a declaration, and detects inconsistent
(re-)declarations of builtins during declaration merging. C++ was
unprotected, and therefore would crash.

Fixes PR8839.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 19:47:46 +00:00
John McCall 00ccbefcff Fix the noreturn conversion to only strip off a single level of indirection.
Apply the noreturn attribute while creating a builtin function's type.
Remove the getNoReturnType() API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 00:44:39 +00:00
John McCall e6a365d772 Motions towards simplifying how we deal with attribute-qualified function types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122162 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 02:44:49 +00:00
Abramo Bagnara 320e153dbc Use hasSameType to compare types for equality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 15:49:53 +00:00
Abramo Bagnara bbca85d14c Avoid to emit redundant implicit cast for enum constants init expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 12:21:11 +00:00
Douglas Gregor a31040f166 Check for unexpanded parameter packs within variable initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 01:31:22 +00:00
Douglas Gregor 6ccab97c17 Check for unexpanded parameter packs in friend declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 01:14:37 +00:00
Douglas Gregor 56c04588ef Check for unexpanded parameter packs in using declarations. As a
drive-by, make sure to check for unexpanded parameter packs within the
name of a declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 00:46:58 +00:00
Douglas Gregor 0c9e4799fd Check for unexpanded parameter packs in enumeration types and enumerators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 00:24:44 +00:00
Douglas Gregor e186269a8a Check for unexpanded parameter packs in various kinds of
declarations. This is a work in progress, as I go through the C++
declaration grammar to identify where unexpanded parameter packs can
occur.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121912 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 23:18:36 +00:00
Argyrios Kyrtzidis 0827408865 Fix diagnostic pragmas.
Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state.
Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect
a lot of places, like C++ inline methods, template instantiations, the lexer, etc.

Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location.

Fixes rdar://8365684.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 18:44:22 +00:00
John McCall bfdcdc8e26 Set the "implicitly inline" bit on a method as soon as we see a definition
within the class.  Teach IR gen to look for function definitions in record
lexical contexts when deciding whether to emit a function whose address    
was taken.  Fixes PR8789.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 04:00:32 +00:00
Abramo Bagnara 723df24530 Added missing IgnoreParens().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14 22:11:44 +00:00
John McCall e23cf437fe Restore r121752 without modification.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14 08:05:40 +00:00
John McCall 5bfe232d1f Pull out r121752 in case it's causing the selfhost breakage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14 07:30:51 +00:00
John McCall 0e88aa7100 Factor out most of the extra state in a FunctionProtoType into a separate
class to be passed around.  The line between argument and return types and
everything else is kindof vague, but I think it's justifiable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14 06:51:39 +00:00
Douglas Gregor d0937224f3 Variadic templates: extend Type, NestedNameSpecifier, TemplateName,
and TemplateArgument with an operation that determines whether there
are any unexpanded parameter packs within that construct. Use this
information to diagnose the appearance of the names of parameter packs
that have not been expanded (C++ [temp.variadic]p5). Since this
property is checked often (every declaration, ever expression
statement, etc.), we extend Type and Expr with a bit storing the
result of this computation, rather than walking the AST each time to
determine whether any unexpanded parameter packs occur.

This commit is deficient in several ways, which will be remedied with
future commits:
  - Expr has a bit to store the presence of an unexpanded parameter
  pack, but it is never set.
  - The error messages don't point out where the unexpanded parameter
  packs were named in the type/expression, but they should. 
  - We don't check for unexpanded parameter packs in all of the places
  where we should.
  - Testing is sparse, pending the resolution of the above three
  issues.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 22:49:22 +00:00
Douglas Gregor 3922ed09db Silence a few more uninitialized-value warnings
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121505 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 19:28:19 +00:00
Fariborz Jahanian 9913d6e086 Fix a compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 17:05:33 +00:00
Abramo Bagnara 075f8f1b6b Added ParenType type node.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121488 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 16:29:40 +00:00
John McCall 49f4e1cbd8 It's kindof silly that ExtQuals has an ASTContext&, and we can use that
space better.  Remove this reference.  To make that work, change some APIs
(most importantly, getDesugaredType()) to take an ASTContext& if they
need to return a QualType.  Simultaneously, diminish the need to return a
QualType by introducing some useful APIs on SplitQualType, which is
just a std::pair<const Type *, Qualifiers>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 11:01:00 +00:00
Fariborz Jahanian bfe5788a00 Refactored/cleanedup ActOnFunctionDeclarator
and ActOnVariableDeclarator
No functionality change. // rdar://8751949


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121427 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 23:11:32 +00:00
Jay Foad 9f71a8f4c7 PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 08:25:34 +00:00
Douglas Gregor 53c374f1ac Use Sema::MaybeCreateExprWithCleanups() only after we've checked for a NULL/invalid expression
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 00:41:46 +00:00
John McCall 4765fa05b5 Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 08:20:24 +00:00
Abramo Bagnara a88cefd266 Added struct/class syntactic info for c++0x scoped enum.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120828 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:54:17 +00:00
Fariborz Jahanian 1ceee5c42d Sema/AST work for capturing copy init expression
to be used in copy helper synthesis of __block
variables. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120617 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 22:29:46 +00:00
Douglas Gregor d11617f6e0 Improve the diagnostic when the fixed underlying type of a
redeclaration of an enum type differs from that of the original
declaration, from Daniel Wallin


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 16:10:38 +00:00
Francois Pichet 8e161ed8e6 Microsoft C anonymous struct implementation.
Documentation: http://msdn.microsoft.com/en-us/library/z2cx9y4f.aspx

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120000 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 06:07:27 +00:00
Francois Pichet 87c2e121cf Major anonymous union/struct redesign.
A new AST node is introduced:
   def IndirectField : DDecl<Value>;
IndirectFields are injected into the anonymous's parent scope and chain back to
the original field. Name lookup for anonymous entities now result in an
IndirectFieldDecl instead of a FieldDecl.
There is no functionality change, the code generated should be the same.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-21 06:08:52 +00:00
Argyrios Kyrtzidis 9c4eb1f343 Refactoring.
Move ErrorTrap from clang/Sema to clang/Basic as DiagnosticErrorTrap and use it in Scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 00:19:12 +00:00
Argyrios Kyrtzidis f4bed3f768 Remove the getDiagnosticLevel check since it doesn't buy us much.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119719 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 18:51:03 +00:00
Argyrios Kyrtzidis 1380a147d4 -Rename -Wargument-larger-than -> -Wlarge-by-value-copy
-Improve the diagnostic message
-Add some comments

Suggestions by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 00:20:36 +00:00
Argyrios Kyrtzidis 3532fdd1db Introduce option -Wargument-larger-than[=N] which warns about function definitions if they take by-value
or return by-value any POD that is larger than some threshold (default is 64 bytes).

Implements rdar://8548050.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 23:11:54 +00:00
Anders Carlsson dfdfc584f2 A union cannot contain static data members or data members of reference type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118381 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-07 19:13:55 +00:00
Sean Hunt 7533a5b65f Provide an error when a non-identifier name (such as an operator) is used as a
parameter name.

Fixes PR8012.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118138 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 01:07:06 +00:00
Douglas Gregor 21e75d00b0 Eliminate an unused local variable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 21:56:54 +00:00
Douglas Gregor 82aa713bcd Require that the types of the parameters of a block literal are complete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 18:37:59 +00:00
John McCall 82b965992f Avoid calculating linkage until the more obvious checks have run when
deciding whether to queue a decl for unused-declaration warnings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117431 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 01:41:35 +00:00
John McCall 5b629aa86c Parse attributes on enumerators and instantiate attributes on enum decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117182 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 23:36:17 +00:00
Douglas Gregor 0bab54cf82 Always treat 'main' as an extern "C" function, so that we detect
redeclarations of main appropriately rather than allowing it to be
overloaded. Also, disallowing declaring main as a template.

Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 16:57:46 +00:00
Craig Silverstein b41d899a60 Pass TInfo to CXXDestructorDecl::Create(), just like we do for other
function decls.

Reviewed by rjmccall and nlewycky.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116979 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 00:44:50 +00:00
John McCall 9a34edb710 Redirect templated friend class decls to a new Sema callback and
construct an unsupported friend when there's a friend with a templated
scope specifier.  Fixes a consistency crash, rdar://problem/8540527


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 01:40:49 +00:00
Anders Carlsson 693d467ed4 Implement the first half of [dcl.attr.override]p6.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 16:24:27 +00:00
Francois Pichet 842e7a22c6 Microsoft enum extensions. 2 things will change on -fms-extensions:
1. enum underlying type is int by default.
2. Error "enumerator value is not representable in the underlying type"is a ExtWarning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116704 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 15:01:13 +00:00
Anders Carlsson 4d09e84fbb Implement [dcl.attr.override]p2 and add tests for p1 and p2.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-17 23:36:12 +00:00
John McCall be04b6df36 Reformatting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116662 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-16 07:23:36 +00:00
John McCall 6102ca1d49 White-listing templated-scope friend decls is a good idea, but doing it
by marking the decl invalid isn't.  Make some steps towards supporting these
and then hastily shut them down at the last second by marking them as
unsupported.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-16 06:59:13 +00:00
Douglas Gregor c6eddf50bf Allow list-initialization of a local variable of class type with a
flexible array member, so long as the flexibility array member is
either not initialized or is initialized with an empty initializer
list. Fixes <rdar://problem/8540437>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116647 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 23:53:28 +00:00
Douglas Gregor a6e937ce32 Diagnose C++ [class.mem]p13-14, where a class member has the same name
as the class itself. Fixes PR7082.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116573 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 13:21:21 +00:00
John McCall b6bbcc9995 Death to blocks, or at least the word "block" in one particular obnoxiously
ambiguous context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 04:57:14 +00:00
Douglas Gregor 66c42d4439 Don't complain about a variable within a linkage-specification that is
initialized. Fixes PR7076.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 01:21:46 +00:00
Argyrios Kyrtzidis 3b8f610ac9 Don't add the injected class name to the redeclarations chain; the chain should contain actual redeclarations, not implicits.
As a bonus, now we don't deserialize it unless we need it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 20:14:21 +00:00
Douglas Gregor a6c1e3a56a Diagnose when a 'static' member function overrides a virtual function
in a base class. Fixes PR8168.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116448 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 22:55:32 +00:00
Douglas Gregor 922fff2c9e Generalize the checking for qualification of (non-friend) class
members. Provide a hard error when the qualification doesn't match the
current class type, or a warning + Fix-it if it does match the current
class type. Fixes PR8159.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116445 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 22:19:53 +00:00
John McCall 29ae6e5fb0 Support friend function declarations in local classes correctly.
Fixes a crash and diagnoses the error condition of an unqualified
friend which doesn't resolve to something.  I'm still not certain how
this is useful.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116393 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 05:45:15 +00:00
John McCall 337ec3d0e8 Handle dependent friends more explicitly and deal with the possibility
of templated-scope friends by marking them invalid and white-listing all
accesses until such time as we implement them.  Fixes a crash, this time
without a broken test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 23:13:28 +00:00
Duncan Sands 240a020bed Pacify gcc-4.4.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 14:07:59 +00:00
Chris Lattner 16c5dea6c2 fix PR8217, a silent miscompilation of invalid code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116166 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-10 18:16:20 +00:00
Argyrios Kyrtzidis 1d1e70ec65 Fix g++.dg regressions introduced at r115347 (rdar://8529993)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-09 04:39:54 +00:00
Douglas Gregor 1274ccd90a Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked a
bit by me). 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 23:50:27 +00:00
John McCall b4eb64d842 Track the location of the context requiring an implicit conversion and use it
to white-list conversions required by system headers.  rdar://problem/8232669



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 02:01:28 +00:00
Argyrios Kyrtzidis 9a2b9d794b Implement -fshort-enums (rdar://8490496).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 00:25:19 +00:00
Douglas Gregor 4a1bb8c4d7 Register the __builtin_va_list_type node when we parse it, rather than
waiting until we think we need it: we didn't catch all of the places
where we actually needed it, and we probably wouldn't ever. Fixes a
C++ PCH crasher.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 15:41:24 +00:00
Francois Pichet c71d8eb659 Better diagnostic for superfluous scope specifier inside a class definition for member functions. + Fixit.
Example: 
class A {
   void A::foo(); //warning: extra qualification on member 'foo'
};


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115347 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 21:19:28 +00:00
Douglas Gregor 7a39dd01ed Move the maintenance of CXXRecordDecl::DefinitionData's Abstract bit
completely into CXXRecordDecl, by adding a new completeDefinition()
function. This required a little reshuffling of the final-overrider
checking code, since the "abstract" calculation in the presence of
abstract base classes needs to occur in
CXXRecordDecl::completeDefinition() but we don't want to compute final
overriders more than one in the common case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115007 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 00:15:42 +00:00
Douglas Gregor 85606ebf3d Reinstate r114925 and r114929, both steps toward
<rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114984 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 20:50:54 +00:00
Fariborz Jahanian c5be7b0fc8 vla expressions used in __typeof__ must be evaluated.
Fixes rdar://8476159.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 20:42:35 +00:00
Douglas Gregor 2cf9d656f6 Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.

This reinstates r114924, with one crucial bug fix: we were ignoring
the implicit fields created by anonymous structs/unions when updating
the bits in CXXRecordDecl, which means that a class/struct containing
only an anonymous class/struct would be considered "empty". Hilarity
follows. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 20:38:10 +00:00
Douglas Gregor 9fe183ae1e Reinstate r114921, which I've exonerated via a self-host build.
Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 19:45:33 +00:00
Bill Wendling 2a674e8e44 Temporarily revert 114929 114925 114924 114921. It looked like they (or at least
one of them) was causing a series of failures:

http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518

svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U    include/clang/Sema/Sema.h
U    include/clang/AST/DeclCXX.h
U    lib/Sema/SemaDeclCXX.cpp
U    lib/Sema/SemaTemplateInstantiateDecl.cpp
U    lib/Sema/SemaDecl.cpp
U    lib/Sema/SemaTemplateInstantiate.cpp
U    lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/Sema/SemaDecl.cpp
G    lib/AST/DeclCXX.cpp
U    lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/Sema/SemaDecl.cpp
G    lib/AST/DeclCXX.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 01:09:49 +00:00
Douglas Gregor e10288c1e9 Centralize the management of CXXRecordDecl::DefinitionData's
HasTrivialConstructor, HasTrivialCopyConstructor,
HasTrivialCopyAssignment, and HasTrivialDestructor bits in
CXXRecordDecl's methods. This completes all but the Abstract bit and
the set of conversion functions, both of which will require a bit of
extra work. The majority of <rdar://problem/8459981> is now
implemented (but not all of it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114929 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 00:00:00 +00:00
Douglas Gregor cdbfa6c411 Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114924 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 23:31:14 +00:00
Douglas Gregor 6e3c7713ca Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114921 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 23:16:44 +00:00
Douglas Gregor 0ed2e0823c Centralize the handling of CXXRecordDecl::DefinitionData's
DeclaredDestructor and UserDeclaredDestructor bits in CXXRecordDecl
itself. Another step on the road to <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 22:48:58 +00:00
Douglas Gregor 3e9438b525 Kill FunctionDecl's IsCopyAssignment bit; it duplicated what could
already be determined by isCopyAssignmentOperator(), and was set too
late in the process for all clients to see the appropriate
value. Cleanup only; no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 22:37:28 +00:00
Douglas Gregor 27c08ab485 Centralize the handling of
CXXRecordDecl::DefinitionData::DeclaredCopyAssignment, for
copy-assignment operators. Another step toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 22:06:20 +00:00
Argyrios Kyrtzidis 2b64239a8e Fix bogus compiler errors when declaring anonymous union, outside a class, with
members with the same name as a decl outside the scope where the members are actually introduced.
Fixes http://llvm.org/PR6741

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114641 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 14:26:01 +00:00
Argyrios Kyrtzidis 355a9fe26a Implement -Wunused-label.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-19 21:21:25 +00:00
Douglas Gregor 069ea64661 When dealing with an anonymous enumeration declared in function
prototype scope, temporarily set the context of the enumeration
declaration to the translation unit. We do the same thing for
parameters, until we have an actual function declaration on which to
hang them. Fixes <rdar://problem/8435682>.

There is more work to do in this area, since we have existing bugs
with tags being declared/defined in function parameter lists. This fix
is correct, and we'll end up extending it when we deal with those
existing bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 23:58:57 +00:00
Francois Pichet 0924618371 Microsoft's flexible array rules relaxation:
- in union
   - as the only element of a struct/class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 00:14:08 +00:00
Francois Pichet 8dc3abcc36 Add basic support for Microsoft enum forward declaration.
Assigning an underlying integral type to an enum forward declaration will come in a next patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113716 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-12 05:06:55 +00:00
John McCall 4e6356426f Support in-class initialization of static const floating-point data members.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113663 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 23:21:22 +00:00
Francois Pichet 538e0d0292 Allow type definitions inside anonymous struct/union in Microsoft mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 11:32:25 +00:00
Gabor Greif a4a301dc74 add a fixit when 'main' does ot return 'int'; review welcome
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 00:31:13 +00:00
Douglas Gregor fbc5b49322 Provide a specific diagnostic when trying to redefine an "extern
inline" function outside of GNU89 mode. Fixes
<rdar://problem/6880464>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 15:51:01 +00:00
Anders Carlsson e63438b34b It's OK for classes to have flexible array elements (but not unions).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113018 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 21:53:49 +00:00
John McCall 8c465e6494 Devirtualize Sema, kill off DeleteExpr and DeleteStmt, and reformat.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112945 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 02:10:08 +00:00
Anders Carlsson 4938f2385f Static local variables don't result in global constructors being emitted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 01:11:38 +00:00
Chandler Carruth 1baf2f778c Fix a regression that allowed clearly ill formed code. The diagnostic is still
terrible, FIXME left to do a proper job of diagnosing this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112581 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 05:42:40 +00:00
Sebastian Redl 7a126a474f Rename DeclContext::getLookupContext to getRedeclContext and change its semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 00:36:30 +00:00
Douglas Gregor 7f6ff02d66 Add redeclaration checking for static data members and fix a corner
case with redeclaration checking for fields, from Faisal Vali!
Fixes PR7970.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112476 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 14:32:14 +00:00
Argyrios Kyrtzidis 9996a7f06a Fix the memory leak of FloatingLiteral/IntegerLiteral.
For large floats/integers, APFloat/APInt will allocate memory from the heap to represent these numbers.
Unfortunately, when we use a BumpPtrAllocator to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
the APFloat/APInt values will never get freed.
I introduce the class 'APNumericStorage' which uses ASTContext's allocator for memory allocation and is used internally by FloatingLiteral/IntegerLiteral.

Fixes rdar://7637185

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 09:06:06 +00:00
Douglas Gregor 757c600d69 Miscellaneous found by inspection with John and Sebastian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-27 22:55:10 +00:00
John McCall f312b1ea17 One who seeks knowledge learns something new every day.
One who seeks the Tao unlearns something new every day.
Less and less remains until you arrive at non-action.
When you arrive at non-action,
nothing will be left undone.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 23:41:50 +00:00
John McCall d931b08698 De-memberify the VarDecl and FunctionDecl StorageClass enums.
This lets us remove Sema.h's dependency on Expr.h and Decl.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112156 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 03:08:43 +00:00
John McCall 2d88708cbe Split out a header to hold APIs meant for the Sema implementation from Sema.h.
Clients of Sema don't need to know (for example) the list of diagnostics we
support.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 22:03:47 +00:00
John McCall 2de56d1d0c GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 11:45:40 +00:00
John McCall 5baba9d983 More incremental progress towards not including Expr.h in Sema.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 10:28:54 +00:00
John McCall 781472fe99 Split FunctionScopeInfo and BlockScopeInfo into their own header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 08:40:02 +00:00
John McCall 384aff8b94 Remove Sema.h's dependency on DeclCXX.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 07:42:41 +00:00
John McCall e0054f61fd Remove AnalysisBasedWarnings.h's dependency on Type.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 05:56:39 +00:00
John McCall fbce0e1d58 It turns out that this template is only instantiated at one type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111908 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 09:05:15 +00:00
John McCall 5f1e0942a3 More header elimination. The goal of all this is to allow Parser to
#include Sema.h while keeping all the AST declarations opaque.  That may
not be reasonably attainable, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111907 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 08:50:51 +00:00
John McCall 7cd088e519 Struggle mightily against header inclusion in Sema.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 07:21:54 +00:00
John McCall 60d7b3a319 OwningExprResult -> ExprResult. This patch brought to you by
M-x query-replace-regexp
\(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111903 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 06:29:42 +00:00
John McCall b3d8748e79 Abstract out passing around types and kill off ActionBase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111901 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 05:47:05 +00:00
Douglas Gregor 3a91abf311 Diagnose the presence of multiple initializations of static data
members, from Faisal Vali! Fixes PR6904.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 05:27:49 +00:00
John McCall 9ae2f076ca Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111863 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 23:25:46 +00:00
Fariborz Jahanian d097be8f81 Handling remaining rule for synthesize bitfields in
class extensions (nonfragile-abi2).For every class @interface and class
extension @interface, if the last ivar is a bitfield of any type,
then add an implicit `char :0` ivar to the end of that interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111857 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 22:46:52 +00:00
Fariborz Jahanian 000835d0b0 Support for IRGen of synthesize bitfield ivars in
objc-nonfragile-abi2 (radar 7824380).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:51:39 +00:00
John McCall 2b5289b6fd Push DeclGroupRefs and TemplateNames in an opaque but type-safe way
through the parser.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 07:28:44 +00:00
John McCall ca0408fb49 Sundry incremental steps towards killing off Action.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 06:44:23 +00:00
John McCall d226f65006 DeclPtrTy -> Decl *
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111733 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 09:40:31 +00:00
John McCall 1951085672 Another step in the process of making the parser depend on Sema:
- move DeclSpec &c into the Sema library
  - move ParseAST into the Parse library
Reflect this change in a thousand different includes.
Reflect this change in the link orders.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 18:27:03 +00:00
Sean Hunt cf807c4dfd Generate Attr subclasses with TableGen.
Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.

Some other notes about newly-generated attribute classes:

 - The constructor arguments are a SourceLocation and a Context&,
   followed by the attributes arguments in the order that they were
   defined in Attr.td

 - Every argument in Attr.td has an appropriate accessor named getFoo,
   and there are sometimes a few extra ones (such as to get the length
   of a variadic argument).

Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:23:40 +00:00
Douglas Gregor 2767ce2e21 Emit an error if an array is too large. We're slightly more strict
than GCC 4.2 here when building 32-bit (where GCC will allow
allocation of an array for which we can't get a valid past-the-end
pointer), and emulate its odd behavior in 64-bit where it only allows
63 bits worth of storage in the array. The former is a correctness
issue; the latter is harmless in practice (you wouldn't be able to use
such an array anyway) and helps us pass a GCC DejaGNU test.

Fixes <rdar://problem/8212293>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 00:39:00 +00:00
Daniel Dunbar 4087f27e54 StringRef'ication of lots stuff, patch by Peter Davies!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111314 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 22:39:59 +00:00
John McCall 2d7d2d99bc A field of incomplete type is sufficiently disruptive that we should mark
the record invalid.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111211 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 23:42:35 +00:00
Argyrios Kyrtzidis dd7744d01e Emit diagnostic error when the field of an anonymous struct is non trivial.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 17:27:08 +00:00
Argyrios Kyrtzidis 06999f8ff6 Don't warn for the common pattern of disallowing copying:
class S {
  S(const S&); // DO NOT IMPLEMENT
  void operator=(const S&); // DO NOT IMPLEMENT
};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 10:17:33 +00:00
Argyrios Kyrtzidis bbc6454bb9 Commit improved version of 111026 & 111027.
Unused warnings for functions:
-static functions
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

Unused warnings for variables:
-static variables
-variables in anonymous namespace
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

Reveals lots of opportunities for dead code removal in llvm codebase that will
interest my esteemed colleagues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 01:15:20 +00:00
Argyrios Kyrtzidis 05eac86d54 Revert 111026 & 111027, build breakage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 20:13:06 +00:00
Argyrios Kyrtzidis 30c0dd86f0 The unused warnings extravaganza continues. Warn for:
-static variables
-variables in anonymous namespace (fixes rdar://7794535)
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 18:42:40 +00:00
Argyrios Kyrtzidis f6d1d43d68 Expand the unused warnings for functions. Warn for:
-static function declarations
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 18:42:29 +00:00
Argyrios Kyrtzidis 49b96d1a38 Change Sema's UnusedStaticFuncs to UnusedFileScopedDecls to allow also keeping track of unused file scoped variables.
This is only preparation, currently only static function definitions are tracked, as before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 18:42:17 +00:00
Douglas Gregor e737f5041a Move Sema's headers into include/clang/Sema, renaming a few along the way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110945 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 20:07:10 +00:00
John McCall fcadea2556 Fix a crash on invalid when declaring an implicit member of a class with an
invalid destructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 00:57:17 +00:00
Abramo Bagnara 2577743c56 Added locations and type source info for DeclarationName.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110860 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 22:01:17 +00:00
Douglas Gregor deacbdca55 Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,
and create separate decl nodes for forward declarations and the
definition," which appears to be causing significant Objective-C
breakage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 12:19:30 +00:00
Eli Friedman bf87f2c1c6 Fix redefinition of typedefs of fixable variably-modified array types; should
fix an issue compiling <windows.h>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 03:13:15 +00:00
Sebastian Redl 74c730ad1f - Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for forward declarations and the definition.
- Eagerly create ObjCInterfaceTypes for declarations.
- The two above changes lead to a 0.5% increase in memory use and no speed regression when parsing Cocoa.h. On the other hand, now chained PCH works when there's a forward declaration in one PCH and the interface definition in another.
- Add HandleInterestingDecl to ASTConsumer. PCHReader passes the "interesting" decls it finds to this function instead of HandleTopLevelDecl. The default implementation forwards to HandleTopLevelDecl, but ASTUnit's handler for example ignores them. This fixes a potential crash when lazy loading of PCH data would cause ASTUnit's "top level" declaration collection to change while being iterated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110610 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 21:55:28 +00:00
John McCall f871d0cc37 Store inheritance paths after CastExprs instead of inside them.
This takes some trickery since CastExpr has subclasses (and indeed,
is abstract).

Also, smoosh the CastKind into the bitfield from Expr.

Drops two words of storage from Expr in the common case of expressions
which don't need inheritance paths.  Avoids a separate allocation and
another word of overhead in cases needing inheritance paths.  Also has
the advantage of not leaking memory, since destructors for AST nodes are
never run.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 06:22:56 +00:00
Douglas Gregor d945538a36 Make sure that we diagnose attribute((overloadable)) functions without
prototypes. Fixes PR7738.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 13:50:58 +00:00
Abramo Bagnara 7c15353cca Template keyword should not be ignored building a QualifiedTemplateName.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110441 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 12:11:11 +00:00
Douglas Gregor ed328c6129 Diagnose the use of "inline" on block-scope function declarations in
C++, from Andrea Nall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110439 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 11:44:10 +00:00
John McCall 9983d2d76c Properly pop out of Objective-C method declarations when they are (ill-formedly)
found within contexts other than the translation unit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110417 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 00:46:05 +00:00
Eli Friedman aa8b0d1924 Implement #pragma GCC visibility.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 06:57:20 +00:00
John McCall 15442825bb Only look up an 'operator delete' on the definition of a destructor, not on
a declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 01:04:25 +00:00
John McCall 4204f07fc8 Further adjustments to -Wglobal-constructors; works for references and direct
initializations now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110063 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 21:13:48 +00:00
Argyrios Kyrtzidis 76c38d3854 Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them that will deserialize them when needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 07:14:54 +00:00
John McCall b4b9b15c59 Kill off RequiresGlobalConstructor in favor of isConstantInitializer.
Note some obvious false positives in the test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-01 21:51:45 +00:00
John McCall 626e96e287 Make a first pass at implementing -Wglobal-constructors. I'm worried that this
will end up bizarrely mirroring CGExprConstant, but that might be the hazard of
this feature.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109984 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-01 20:20:59 +00:00
John McCall b567a8b94c Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109965 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-01 01:25:24 +00:00
John McCall e46f62cbaa Don't consider all local variables in C++ to mandate scope-checking, just
those with initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109964 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-01 01:24:59 +00:00
John McCall b60a77e453 Only run the jump-checker if there's a branch-protected scope *and* there's
a switch or goto somewhere in the function.  Indirect gotos trigger the
jump-checker regardless, because the conditions there are slightly more
elaborate and it's too marginal a case to be worth optimizing.

Turns off the jump-checker in a lot of cases in C++.  rdar://problem/7702918


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-01 00:26:45 +00:00
Abramo Bagnara 35f9a196ef Fixed typedef inside extern "C".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 16:47:02 +00:00
Douglas Gregor 447234dd45 Allow a looser form of compatibility checking (which ignores
qualifiers) when checking a K&R function definition against a previous
prototype. Fixes <rdar://problem/8193107>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 15:18:02 +00:00
Douglas Gregor 98c2e6248f Don't set out-of-line template specialization/definition information
for AST nodes that aren't actually out-of-line (i.e., require a
nested-name-specifier). Fixes <rdar://problem/8204126>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109704 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 23:59:57 +00:00
Dan Gohman 3c46e8db99 Fix namespace polution.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 21:25:24 +00:00
Douglas Gregor ff331c1572 Remove the vast majority of the Destroy methods from the AST library,
since we aren't going to be calling them ever.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-25 18:17:45 +00:00
Douglas Gregor f178dcab50 Be careful; even though we had a proper name at the beginning of
Sema::ActOnDeclarator doesn't mean that the Decl we ended up creating
has a useful name. <rdar://problem/8229910>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 00:10:38 +00:00
John McCall acb7039ca3 We never want to pop the translation unit DC, so assert if this happens.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109280 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 22:45:07 +00:00
Sebastian Redl 906082edf2 Update ImplicitCastExpr to be able to represent an XValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 04:20:21 +00:00
Douglas Gregor a0ebd60bfd Revert Microsoft-specific override of the "typedef requires a name"
diagnostic. Instead, put it and the "declaration does not declare
anything" warning into -Wmissing-declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 15:40:40 +00:00
Douglas Gregor 0c99ec6d22 Suppress the "typedef requires a name" warning in Microsoft-extensions mode
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108526 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 15:18:19 +00:00
John McCall c9068d7dd9 Treat template parameters as part of the declaration-specifiers for the
purpose of access control.  Fixes PR7644.

I can't actually find anything directly justifying this, but it seems obvious.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108521 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 08:13:16 +00:00
Chandler Carruth b21fc4a4c1 Butcher a perfectly reasonable diagnostic to pacify old versions of SWIG.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108505 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 04:32:28 +00:00
Ted Kremenek bee05c1206 Add builtin definition for scanf, including extending the builtin encoding to
represent builtins that have the "scanf" attribution (via the format attribute) just
like we do with printf functions.  Follow-up work is needed to add similar support
for fscanf et al.

This is to support format-string checking for scanf functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 02:11:15 +00:00
Douglas Gregor 0167f3c255 When there are extra or missing template parameter lists in a template
definition, we're likely going to end up breaking the invariants of
the template system, e.g., that the depths of template parameter lists
match up with the nesting template of the template. So, make sure we
mark such ill-formed declarations as invalid or don't even build them
at all.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108372 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 23:14:12 +00:00
Douglas Gregor aef01998af Diagnose typedef of an operator name. Fixes PR7462
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 06:37:01 +00:00
Douglas Gregor a131d0fc0a Complain when an unnamed enumeration has no enumerations (in
C++). Fixes PR7466.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108231 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 06:24:26 +00:00
Sebastian Redl f9ea1f392a Produce an error on encountering a pointer or reference to a qualified function type. Fixes PR7470.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 23:11:43 +00:00
Argyrios Kyrtzidis 06a54a38be Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH.
Makes de-serialization of the function body even more "lazier".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107768 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 11:31:19 +00:00
Douglas Gregor 4923aa25eb Lazily declare the implicitly-declared destructor in a C++ class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107510 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 20:37:36 +00:00
Douglas Gregor db89f289a2 Add a new routine Sema::LookupDestructor and make all destructor-lookup calls use that routine
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 22:47:18 +00:00
Douglas Gregor 1d110e05e0 Remove unnecessary ASTContext parameter from
CXXRecordDecl::getDestructor(); no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107394 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 14:13:13 +00:00
Douglas Gregor d92ec474fa Reinstate fix for PR7526, which was failing because, now that we
aren't dropping all exception specifications on destructors, the
exception specifications on implicitly-declared destructors were
detected as being wrong (which they were). 

Introduce logic to provide a proper exception-specification for
implicitly-declared destructors. This also fixes PR6972.

Note that the other implicitly-declared special member functions also
need to get exception-specifications. I'll deal with that in a
subsequent commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 05:10:53 +00:00
Douglas Gregor 4b662a5684 Revert r107374, which broke bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 03:28:42 +00:00
Douglas Gregor 2fef752aeb When building the type of a destructor, make sure to keep the
exception specification. Fixes PR7526.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 02:33:15 +00:00