|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| 
| | we look for shadow friend decls in the appropriate scope before injecting
a new declaration.
llvm-svn: 99552 | 
| | 
| 
| 
| 
| 
| | extension (radar 6812436).
llvm-svn: 99408 | 
| | 
| 
| 
| 
| 
| 
| 
| | since we have absolutely no way to match them when they are declared
nor do we have a way to represent these parsed-but-not-checked friend
declarations.
llvm-svn: 99407 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | template <> friend void foo(int);
we need to change it to
  friend void foo<>(int);
or else the user won't get the template specialization they obviously want.
llvm-svn: 99390 | 
| | 
| 
| 
| | llvm-svn: 99389 | 
| | 
| 
| 
| 
| 
| 
| | DeclContext because we don't want a NULL DeclContext. Instead, use the
current context.
llvm-svn: 99281 | 
| | 
| 
| 
| 
| 
| 
| | are called (transitively) by regular functions/blocks within a
translation untion.
llvm-svn: 99233 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | entering a function or block definition, not on every single declaration.
Unfortunately we don't have previous-lookup results around when it's time
to make this decision, so we have to redo the lookup.  The alternative is
to use delayed diagnostics.
llvm-svn: 99172 | 
| | 
| 
| 
| 
| 
| 
| | If a struct has an invalid field, mark it as invalid. Also avoid producing
errors about incomplete types that are invalid.
llvm-svn: 99150 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | AnalysisBasedWarnings.
This object controls when the warnings are executed, allowing the client code
in Sema to selectively disable warnings as needed.
Centralizing the logic for analysis-based warnings allows us to optimize
when and how they are run.
Along the way, remove the redundant logic for the 'check fall-through' warning
for blocks; now the same logic is used for both blocks and functions.
llvm-svn: 99085 | 
| | 
| 
| 
| | llvm-svn: 99037 | 
| | 
| 
| 
| 
| 
| 
| 
| | lookups
so they don't trigger diagnostics like (say) access control.
llvm-svn: 98806 | 
| | 
| 
| 
| 
| 
| 
| 
| | ActOnStartCXXMemberDeclaration.  We haven't started the field collector on this
class yet, so don't stop it.  Fixes a crash in the VS buildbot and a memory error
on all the others.
llvm-svn: 98760 | 
| | 
| 
| 
| 
| 
| 
| | considered to be a part of the translation unit unless they're named
in a way that brings them into existence.
llvm-svn: 98729 | 
| | 
| 
| 
| 
| 
| | Fixes the crash-on-invalid in PR6629.
llvm-svn: 98698 | 
| | 
| 
| 
| | llvm-svn: 98684 | 
| | 
| 
| 
| 
| 
| | that occur in constructors (on the unwind path).
llvm-svn: 98681 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | on unqualified declarations.
Patch by Enea Zaffanella!  Minimal adjustments:  allocate the ExtInfo nodes
with the ASTContext and delete them during Destroy().  I audited a bunch of
Destroy methods at the same time, to ensure that the correct teardown was
being done.
llvm-svn: 98540 | 
| | 
| 
| 
| | llvm-svn: 98397 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | instantiation.  Based on a patch by Enea Zaffanella!  I found a way to
reduce some of the redundancy between TreeTransform's "standard"
FunctionProtoType transformation and TemplateInstantiator's override,
and I killed off the old SubstFunctionType by adding type source info
for the last cases where we were creating FunctionDecls without TSI
(at least that get passed through template instantiation).
llvm-svn: 98252 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | injected class name of a class template or class template partial specialization.
This is a non-canonical type;  the canonical type is still a template 
specialization type.  This becomes the TypeForDecl of the pattern declaration,
which cleans up some amount of code (and complicates some other parts, but
whatever).
Fixes PR6326 and probably a few others, primarily by re-establishing a few
invariants about TypeLoc sizes.     
llvm-svn: 98134 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | uninitialized. This seems not to be the case in C++0x, where we still
call the (trivial) default constructor for a POD class
(!). Previously, we had implemented only the C++0x rules; now we
implement both. Fixes PR6536.
llvm-svn: 97928 | 
| | 
| 
| 
| 
| 
| 
| | are lexically nested.  Othewise, we never end up recording semantically nested
classes.
llvm-svn: 97900 | 
| | 
| 
| 
| 
| 
| | careful about value-dependent enumerators. Fixes PR5786.
llvm-svn: 97570 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | which has the label map, switch statement stack, etc. Previously, we
had a single set of maps in Sema (for the function) along with a stack
of block scopes. However, this lead to funky behavior with nested
functions, e.g., in the member functions of local classes.
The explicit-stack approach is far cleaner, and we retain a 1-element
cache so that we're not malloc/free'ing every time we enter a
function. Fixes PR6382.
Also, tweaked the unused-variable warning suppression logic to look at
errors within a given Scope rather than within a given function. The
prior code wasn't looking at the right number-of-errors count when
dealing with blocks, since the block's count would be deallocated
before we got to ActOnPopScope. This approach works with nested
blocks/functions, and gives tighter error recovery.
llvm-svn: 97518 | 
| | 
| 
| 
| 
| 
| 
| | re-declare them. This fixes PR6317. Also add the beginnings of an interesting
test case for p1 of [class.friend] which also covers PR6317.
llvm-svn: 97499 | 
| | 
| 
| 
| 
| 
| | in it.
llvm-svn: 97498 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | a fixme and PR6451.
Only perform jump checking if the containing function has no errors,
and add the infrastructure needed to do this.
On the testcase in the PR, we produce:
t.cc:6:3: error: illegal goto into protected scope
  goto later;
  ^
t.cc:7:5: note: jump bypasses variable initialization
  X x;
    ^
llvm-svn: 97497 | 
| | 
| 
| 
| 
| 
| | cases.
llvm-svn: 97134 | 
| | 
| 
| 
| | llvm-svn: 97002 | 
| | 
| 
| 
| | llvm-svn: 96819 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | errors, e.g.:
t.c:1:21: error: redefinition of parameter 'x'
int test(int x, int x);
                    ^
t.c:1:14: note: previous declaration is here
int test(int x, int x);
             ^
llvm-svn: 96769 | 
| | 
| 
| 
| 
| 
| 
| 
| | fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.
llvm-svn: 96766 | 
| | 
| 
| 
| 
| 
| 
| | 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.
llvm-svn: 96729 | 
| | 
| 
| 
| 
| 
| | -fms-extensions is enabled.  Fixes <rdar://problem/7669559>.
llvm-svn: 96721 | 
| | 
| 
| 
| 
| 
| | instead relies on their DeclContext for iteration, etc.
llvm-svn: 96638 | 
| | 
| 
| 
| 
| 
| | does. Fixes PR5253.
llvm-svn: 96553 | 
| | 
| 
| 
| 
| 
| 
| | sure that we get the "too large" vs. "too small" part of the
diagnostic correct.
llvm-svn: 96524 | 
| | 
| 
| 
| 
| 
| | functions to warn about. Update test case.
llvm-svn: 96452 | 
| | 
| 
| 
| 
| 
| | missing (in c/objc mode). Fixes radar 7528255.
llvm-svn: 96017 | 
| | 
| 
| 
| | llvm-svn: 95940 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | array allocated using the allocator in ASTContext.  This addresses
these strings getting leaked when using a BumpPtrAllocator (in
ASTContext).
Fixes: <rdar://problem/7636765>
llvm-svn: 95853 | 
| | 
| 
| 
| 
| 
| | Decl subclasses. No functionality change.
llvm-svn: 95841 | 
| | 
| 
| 
| 
| 
| 
| | and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.
llvm-svn: 95836 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Sema::ActOnUninitializedDecl over to InitializationSequence (with
default initialization), eliminating redundancy. More importantly, we
now check that a const definition in C++ has an initilizer, which was
an #if 0'd code for many, many months. A few other tweaks were needed
to get everything working again:
  - Fix all of the places in the testsuite where we defined const
    objects without initializers (now that we diagnose this issue)
  - Teach instantiation of static data members to find the previous
    declaration, so that we build proper redeclaration
    chains. Previously, we had the redeclaration chain but built it
    too late to be useful, because...
  - Teach instantiation of static data member definitions not to try
    to check an initializer if a previous declaration already had an
    initializer. This makes sure that we don't complain about static
    const data members with in-class initializers and out-of-line
    definitions.
  - Move all of the incomplete-type checking logic out of
    Sema::FinalizeDeclaratorGroup; it makes more sense in
    ActOnUnitializedDecl.
There may still be a few places where we can improve these
diagnostics. I'll address that as a separate commit.
llvm-svn: 95657 | 
| | 
| 
| 
| | llvm-svn: 95494 | 
| | 
| 
| 
| | llvm-svn: 95472 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | follows (as conservatively as possible) gcc's current behavior:  attributes
written on return types that don't apply there are applied to the function
instead, etc.  Only parse CC attributes as type attributes, not as decl attributes;
don't accepet noreturn as a decl attribute on ValueDecls, either (it still
needs to apply to other decls, like blocks).  Consistently consume CC/noreturn
information throughout codegen;  enforce this by removing their default values
in CodeGenTypes::getFunctionInfo().
llvm-svn: 95436 | 
| | 
| 
| 
| 
| 
| 
| | initializer (for no initialization) rather than a ParenListExpr with
zero arguments in it.
llvm-svn: 95382 | 
| | 
| 
| 
| 
| 
| | is a constructor for that class, right? Fixes PR6238. 
llvm-svn: 95367 |