summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Disable the "'extern' variable has an initializer" warning in C++,Douglas Gregor2010-04-191-1/+2
| | | | | | | since it makes sense there to have const extern variables. Fixes PR6495. llvm-svn: 101818
* Start working on handling wide bitfields in C++Anders Carlsson2010-04-161-4/+16
| | | | llvm-svn: 101464
* Feed proper source-location information into Sema::LookupSingleResult,Douglas Gregor2010-04-151-19/+24
| | | | | | | | in case it ends up doing something that might trigger diagnostics (template instantiation, ambiguity reporting, access reporting). Noticed while working on PR6831. llvm-svn: 101412
* Improve the bit-field too wide error message.Anders Carlsson2010-04-151-2/+2
| | | | llvm-svn: 101384
* Fix a few cases where enum constant handling was usingDouglas Gregor2010-04-151-3/+3
| | | | | | | | | | ASTContext::getTypeSize() rather than ASTContext::getIntWidth() for the width of an integral type. The former includes padding for bools (to the target's size) while the latter does not, so we woud end up zero-extending bools to the target width when we shouldn't. Fixes a crash-on-valid in the included test. llvm-svn: 101372
* Teach typo correction about various language keywords. We can'tDouglas Gregor2010-04-141-26/+30
| | | | | | | | | | | | | generally recover from typos in keywords (since we would effectively have to mangle the token stream). However, there are still benefits to typo-correcting with keywords: - We don't make stupid suggestions when the user typed something that is similar to a keyword. - We can suggest the keyword in a diagnostic (did you mean "static_cast"?), even if we can't recover and therefore don't have a fix-it. llvm-svn: 101274
* Mark a function declaration invalid if any of its parameter declarationsJohn McCall2010-04-141-0/+3
| | | | | | | are invalid. Prevents a crash-on-invalid during template instantiation. I... really don't understand how this wasn't already present. llvm-svn: 101203
* Support befriending members of class template specializations.John McCall2010-04-131-7/+4
| | | | llvm-svn: 101173
* Allow classes to befriend implicitly-declared members. Fixes PR6207 forJohn McCall2010-04-131-9/+18
| | | | | | members of non-templated classes. llvm-svn: 101122
* Parse constructor names in friend declarations. Part of the fix forJohn McCall2010-04-131-1/+8
| | | | | | PR6207. llvm-svn: 101119
* Don't try to find a scope corresponding to the search DC for an unfoundJohn McCall2010-04-131-8/+0
| | | | | | | friend declaration; this used to be important but is now just a waste of time plus an unreasonable assertion. Fixes PR6174. llvm-svn: 101112
* Fix a crash-on-invalid involving name lookup of tag names, where weDouglas Gregor2010-04-121-2/+1
| | | | | | | ended up finding a function template that we didn't expect. Recover more gracefully, and fix a similar issue for class templates. llvm-svn: 101040
* Be sure to instantiate the parameters of a function, even when theDouglas Gregor2010-04-121-38/+43
| | | | | | | | | | | | | | | | | | | | function's type is (strictly speaking) non-dependent. This ensures that, e.g., default function arguments get instantiated properly. And, since I couldn't resist, collapse the two implementations of function-parameter instantiation into calls to a single, new function (Sema::SubstParmVarDecl), since the two had nearly identical code (and each had bugs the other didn't!). More importantly, factored out the semantic analysis of a parameter declaration into Sema::CheckParameter, which is called both by Sema::ActOnParamDeclarator (when parameters are parsed) and when a parameter is instantiated. Previously, we were missing some Objective-C and address-space checks on instantiated function parameters. Fixes PR6733. llvm-svn: 101029
* Don't warn about unused static functions if they are marked with Chris Lattner2010-04-091-1/+3
| | | | | | attr constructor or destructor. Patch by Jean-Daniel Dupas! llvm-svn: 100870
* Downgrade the "declaration does not declare anything" error to aDouglas Gregor2010-04-081-3/+2
| | | | | | | warning. It's not harmful to have such pointless declarations, and GCC does not diagnose this issue consistently. llvm-svn: 100814
* Explain that a template needs arguments to make it into a type, forJeffrey Yasskin2010-04-081-0/+18
| | | | | | variable declarations. llvm-svn: 100809
* Make CXXScopeSpec invalid when incomplete, and propagate that into anyJeffrey Yasskin2010-04-081-3/+3
| | | | | | | Declarator that depends on it. This fixes several redundant errors and bad recoveries. llvm-svn: 100779
* Implement dependent friend function template specializations.John McCall2010-04-081-17/+32
| | | | llvm-svn: 100753
* Fix some redundant errors by changing CXXScopeSpec::isSet calls intoJeffrey Yasskin2010-04-071-1/+1
| | | | | | isNotEmpty calls. llvm-svn: 100722
* Patch to not build ivar ASTs when they are ilegallyFariborz Jahanian2010-04-061-11/+17
| | | | | | declared in categories. llvm-svn: 100577
* Sema/Obj-C: Simplify -- eliminate dead casts & provable asserts, and narrow ↵Daniel Dunbar2010-04-021-7/+5
| | | | | | type. llvm-svn: 100197
* Improve diagnostics when an elaborated-type-specifer containing aDouglas Gregor2010-03-311-1/+2
| | | | | | | | | | | | | | | | nested-name-specifier (e.g., "class T::foo") fails to find a tag member in the scope nominated by the nested-name-specifier. Previously, we gave a bland error: 'Nested' does not name a tag member in the specified scope which didn't actually say where we were looking, which was rather horrible when the nested-name-specifier was instantiated. Now, we give something a bit better: error: no class named 'Nested' in 'NoDepBase<T>' llvm-svn: 100060
* Extend DependentNameType with a keyword enum that specifies whetherDouglas Gregor2010-03-311-1/+3
| | | | | | | this was parsed as a typename-specifier, elaborated-type-specifier (including the kind), or just a dependent qualified type name. llvm-svn: 100039
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-311-25/+18
| | | | | | the C-only "optimization". llvm-svn: 100022
* Rename TypenameType to DependentNameType in anticipation of someDouglas Gregor2010-03-311-3/+3
| | | | | | refactoring work in this area. llvm-svn: 100019
* Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor2010-03-311-18/+25
| | | | llvm-svn: 100018
* Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor2010-03-311-25/+18
| | | | | | | term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. llvm-svn: 100008
* Support __attribute__((unused)) on types. This suddenly started firingJohn McCall2010-03-311-2/+18
| | | | | | a lot for me on selfhosts, I dunno why. llvm-svn: 99981
* Fix PR6327: restore invariants when there's a parse error in an initializer.John McCall2010-03-311-0/+35
| | | | llvm-svn: 99980
* the big refactoring bits of PR3782.Rafael Espindola2010-03-301-15/+17
| | | | | | | | This introduces FunctionType::ExtInfo to hold the calling convention and the noreturn attribute. The next patch will extend it to include the regparm attribute and fix the bug. llvm-svn: 99920
* Implement method friends in class templates and fix a few related problems.John McCall2010-03-271-4/+15
| | | | llvm-svn: 99708
* When finishing a function definition, leave the function definition *after*John McCall2010-03-251-2/+3
| | | | | | | doing all the cleanup tasks and checks. This gives us the proper context for checking access to base and member destructors. llvm-svn: 99559
* Handle simple friend-class decls in class templates better by ensuring thatJohn McCall2010-03-251-61/+79
| | | | | | | we look for shadow friend decls in the appropriate scope before injecting a new declaration. llvm-svn: 99552
* Improve diagnostics when ivar added to classFariborz Jahanian2010-03-241-1/+1
| | | | | | extension (radar 6812436). llvm-svn: 99408
* Silently drop dependent friend function template specializations,Douglas Gregor2010-03-241-4/+11
| | | | | | | | 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
* Correct that last fixit: if the user wroteJohn McCall2010-03-241-2/+17
| | | | | | | | | 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
* Support friend function specializations.John McCall2010-03-241-0/+10
| | | | llvm-svn: 99389
* When recovering from a qualified typedef name, don't clear out theDouglas Gregor2010-03-231-1/+2
| | | | | | | DeclContext because we don't want a NULL DeclContext. Instead, use the current context. llvm-svn: 99281
* Only perform CFG-based warnings on 'static inline' functions thatTed Kremenek2010-03-231-4/+3
| | | | | | | are called (transitively) by regular functions/blocks within a translation untion. llvm-svn: 99233
* -Wshadow should only warn about parameter declarations when we'reJohn McCall2010-03-221-12/+22
| | | | | | | | | 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
* Fix PR6618.Rafael Espindola2010-03-211-0/+4
| | | | | | | If a struct has an invalid field, mark it as invalid. Also avoid producing errors about incomplete types that are invalid. llvm-svn: 99150
* Refactor CFG-based warnings in Sema to be run by a worked object called ↵Ted Kremenek2010-03-201-14/+22
| | | | | | | | | | | | | | | 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
* Implement -Wshadow for parameter declarations as well.John McCall2010-03-201-18/+36
| | | | llvm-svn: 99037
* Redeclaration lookups for parameter names should be flagged as redeclaration ↵John McCall2010-03-181-1/+5
| | | | | | | | lookups so they don't trigger diagnostics like (say) access control. llvm-svn: 98806
* ActOnTagDefinitionError is supposed to 'unwind' ActOnTagStartDefinition, notJohn McCall2010-03-171-3/+3
| | | | | | | | 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
* Remove warning about shadowing a built-in; built-ins aren't actuallyDouglas Gregor2010-03-171-9/+1
| | | | | | | considered to be a part of the translation unit unless they're named in a way that brings them into existence. llvm-svn: 98729
* Clean up after ourselves when there's an error parsing the base clause.John McCall2010-03-171-0/+12
| | | | | | Fixes the crash-on-invalid in PR6629. llvm-svn: 98698
* Implement -Wshadow. Based on a patch by Mike M.!John McCall2010-03-161-0/+62
| | | | llvm-svn: 98684
* Perform access control for the implicit calls to base and member destructorsJohn McCall2010-03-161-1/+2
| | | | | | that occur in constructors (on the unwind path). llvm-svn: 98681
* Remember declaration scope qualifiers in the AST. Imposes no memory overheadJohn McCall2010-03-151-0/+18
| | | | | | | | | | | 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
OpenPOWER on IntegriCloud