summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-11/+11
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Extend the self-reference warning to catch when a constructor references ↵Richard Trieu2011-09-011-13/+60
| | | | | | | | | itself upon initialization, such as using itself within its own copy constructor. struct S {}; S s(s); llvm-svn: 138969
* objective-c: this patch (re)introduces objective-c's default propertyFariborz Jahanian2011-08-311-18/+0
| | | | | | | | | | synthesis. This new feature is currently placed under -fobjc-default-synthesize-properties option and is off by default pending further testing. It will become the default feature soon. // rdar://8843851 llvm-svn: 138913
* Minor clean up of objc's decl context stuff.Fariborz Jahanian2011-08-291-1/+1
| | | | | | No change in functionality. llvm-svn: 138742
* Warn on missing [super finalize] calls.Nico Weber2011-08-281-0/+6
| | | | | | This matches gcc's logic. Second half of PR10661. llvm-svn: 138730
* Introduce support for a simple module import declaration, whichDouglas Gregor2011-08-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | loads the named module. The syntax itself is intentionally hideous and will be replaced at some later point with something more palatable. For now, we're focusing on the semantics: - Module imports are handled first by the preprocessor (to get macro definitions) and then the same tokens are also handled by the parser (to get declarations). If both happen (as in normal compilation), the second one is redundant, because we currently have no way to hide macros or declarations when loading a module. Chris gets credit for this mad-but-workable scheme. - The Preprocessor now holds on to a reference to a module loader, which is responsible for loading named modules. CompilerInstance is the only important module loader: it now knows how to create and wire up an AST reader on demand to actually perform the module load. - We search for modules in the include path, using the module name with the suffix ".pcm" (precompiled module) for the file name. This is a temporary hack; we hope to improve the situation in the future. llvm-svn: 138679
* Refactor and fix checking for initialization of flexible array members. The ↵Eli Friedman2011-08-231-21/+0
| | | | | | | | old version had the checks scattered across the code, missed some checks, and had a couple nasty bugs in existing checks. Fixes PR10648 and another similar accepts-invalid bug. llvm-svn: 138398
* Fix an incorrect note.Matt Beaumont-Gay2011-08-231-1/+1
| | | | | | | | For the test case added to function-redecl.cpp, we were previously complaining about a mismatch in the parameter types, since the definition used the typedef'd type. llvm-svn: 138318
* Warn on missing [super dealloc] calls.Nico Weber2011-08-221-0/+7
| | | | | | This matches gcc's logic. Half of PR10661. llvm-svn: 138240
* Restore patch I reversed in r138040. Known buildbotFariborz Jahanian2011-08-221-11/+23
| | | | | | failures are resolved. llvm-svn: 138234
* Revers r138040. Need to look at a few buildbot failures.Fariborz Jahanian2011-08-191-23/+11
| | | | llvm-svn: 138049
* objective-c: Bring objective-c handling of decl contextFariborz Jahanian2011-08-191-11/+23
| | | | | | | | | | to modernity. Instead of passing down individual context objects from parser to sema, establish decl context in parser and have sema access current context as needed. I still need to take of Doug's comment for minor cleanups. llvm-svn: 138040
* Fix the rest of the indent goofiness here.Chandler Carruth2011-08-191-3/+3
| | | | llvm-svn: 138024
* Fix an egregious formatting goof.Chandler Carruth2011-08-191-19/+19
| | | | llvm-svn: 138023
* Don't accept a typo correction if the corrected identifier is the same as theKaelyn Uhrain2011-08-181-1/+2
| | | | | | uncorrected identifier. Fixes a problem pointed out by Eli. llvm-svn: 137987
* Rework DiagnoseInvalidRedeclaration to add the ability to correct typos whenKaelyn Uhrain2011-08-181-23/+69
| | | | | | diagnosing invalid function redeclarations. llvm-svn: 137966
* Track in the AST whether a function is constexpr.Richard Smith2011-08-151-4/+52
| | | | llvm-svn: 137653
* Implement function template specialization at class scope extension in ↵Francois Pichet2011-08-141-9/+35
| | | | | | | | | | | | | | | | | Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization. Example: template <class T> class A { public: template <class U> void f(U p) { } template <> void f(int p) { } // <== class scope specialization }; This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code. BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error. llvm-svn: 137573
* Fix some comments.Richard Smith2011-08-121-5/+3
| | | | llvm-svn: 137491
* Overriding the predefined Protocol isn't something that's actuallyDouglas Gregor2011-08-121-5/+0
| | | | | | | done and is likely to not work well anyway; take away this unnecessary complexity. llvm-svn: 137465
* Encapsulate the Objective-C id/Class/SEL "redefinition" types inDouglas Gregor2011-08-111-3/+3
| | | | | | | | | ASTContext with accessors/mutators. The only functional change is that the AST writer won't bother writing the id/Class/SEL redefinition type if it hasn't been explicitly set; previously, it ended up being written as a synonym for the built-in id/Class/SEL. llvm-svn: 137349
* Match type names and give more info for out-of-line function definition errors.Kaelyn Uhrain2011-08-041-8/+43
| | | | | | | | | | | | | | Having a function declaration and definition with different types for a parameter where the types have same (textual) name can occur when an unqualified type name resolves to types in different namespaces in each location. The error messages have been extended by adding notes that point to the first parameter of the function definition that doesn't match the declaration, instead of a generic "member declaration nearly matches". The generic message is still used in cases where the mismatch is not in the paramenter list, such as mismatched cv qualifiers on the member function itself. llvm-svn: 136891
* Make the type of the IntegerLiteral for bitfield paddings an actualDouglas Gregor2011-08-031-3/+4
| | | | | | | | integer, and initialise its TypeSourceInfo. The initialisation fixes a crash when using pre-compiled preambles with C++ code-completion. From Erik Verbruggen! Fixes PR10511. llvm-svn: 136786
* Add a fixit for removal of unused label.Anna Zaks2011-07-281-1/+17
| | | | llvm-svn: 136389
* Make Sema::LocallyScopedExternalDecls lazily deserialized. In theory,Douglas Gregor2011-07-281-3/+20
| | | | | | | | | we could turn this into an on-disk hash table so we don't load the whole thing the first time we need it. However, it tends to be very, very small (i.e., empty) for most precompiled headers, so it isn't all that interesting. llvm-svn: 136352
* Provide fixit for static use of objective-c typeFariborz Jahanian2011-07-261-9/+22
| | | | | | | in few more places and in each instance, fix up the type to the expected type. // rdar://9603056 llvm-svn: 136103
* objective-c: Provide a 'fixit' when class was usedFariborz Jahanian2011-07-251-1/+2
| | | | | | to declare a static object. // rdar://9603056 llvm-svn: 135970
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-13/+13
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* In Objective-C, pull arbitrary attributes from overriddenJohn McCall2011-07-221-3/+12
| | | | | | | | | | | | | | | methods, including indirectly overridden methods like those declared in protocols and categories. There are mismatches that we would like to diagnose but aren't yet, but this is fine for now. I looked at approaches that avoided doing this lookup unless we needed it, but the infer-related-result-type checks were doing it anyway, so I left it with the same fast-path check for no previous declartions of that selector. llvm-svn: 135743
* Add a hackaround to avoid the crash in PR10355. However, our recoveryDouglas Gregor2011-07-141-2/+4
| | | | | | | is still terrible here because typo correction is not behaving well in the presence of overloaded functions. llvm-svn: 135128
* Add 'mutable' to the function declarator chunk, to be used whenDouglas Gregor2011-07-131-0/+1
| | | | | | parsing lambda expressions, from John Freeman! llvm-svn: 135090
* Fix an incorrect namespace typo-correction diagnostic, from KaelynDouglas Gregor2011-07-131-3/+0
| | | | | | Uhrain! Fixes PR10318. llvm-svn: 135086
* Fix a bug where a local variable named 'self' is causingFariborz Jahanian2011-07-121-0/+1
| | | | | | | implicit ivar accesses to go through the 'self' variable rather than the real 'self' for the method. // rdar://9730771 llvm-svn: 134992
* Centralize the getCanonicalType() calls in the Itanium C++ manglingDouglas Gregor2011-07-121-1/+2
| | | | | | code so that they only occur in a single place. No functionality change. llvm-svn: 134961
* Don't complain about missing return statements for nakedDouglas Gregor2011-07-111-0/+4
| | | | | | functions. Fixes <rdar://problem/9731999>. llvm-svn: 134897
* Remove unused parameter from ActOnDeclarator.Anders Carlsson2011-07-041-3/+2
| | | | llvm-svn: 134377
* Fix a typo, remove a tab, canonicalize some spacing. No functional change.Nick Lewycky2011-07-021-3/+3
| | | | llvm-svn: 134305
* Fix for PR7410. Allow functions in a derived class that improperly overwrite ↵Richard Trieu2011-07-011-1/+1
| | | | | | a virtual function in the base class to be inserted into the derived class function list to prevent extra errors every time the derived class is used. llvm-svn: 134251
* Fix AST representations of alias-declarations which define tag types. Inside ↵Richard Smith2011-07-011-1/+6
| | | | | | classes, the tag types need to have an associated access specifier, and inside function definitions, they need to be included in the declarations of the DeclStmt. These issues manifested as assertions during template instantiation, and also in a WIP constexpr patch. llvm-svn: 134250
* When redeclaring a local extern in the same scope, make sure that weDouglas Gregor2011-06-291-2/+12
| | | | | | | replace the existing declaration appropriately. Patch by Jordy Rose, fixes PR10013 / <rdar://problem/9584157>. llvm-svn: 134097
* Add support for C++ namespace-aware typo correction, e.g., correctingDouglas Gregor2011-06-281-32/+46
| | | | | | | | | | | | | | | vector<int> to std::vector<int> Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes PR5776/<rdar://problem/8652971>. Thanks Kaelyn! llvm-svn: 134007
* Centralize all checks for a C++ tag definition inside a typename inArgyrios Kyrtzidis2011-06-281-1/+1
| | | | | | | | Sema::GetTypeForDeclarator and remove its 'OwnedDecl' out parameter. No functionality change. llvm-svn: 133986
* Centralize the check for a tag definition in a Declarator::PrototypeContext ↵Argyrios Kyrtzidis2011-06-281-9/+1
| | | | | | | | inside GetTypeForDeclarator. No functionality change. llvm-svn: 133985
* Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about ↵Argyrios Kyrtzidis2011-06-241-5/+5
| | | | | | | | 'ownership', not 'lifetime'. rdar://9477613. llvm-svn: 133779
* Remove multiple use of weak_import attribute onFariborz Jahanian2011-06-231-1/+1
| | | | | | same declaration. Templatize dropAttr for general use. llvm-svn: 133724
* Remove weak_import attribute on new declaration.Fariborz Jahanian2011-06-231-3/+1
| | | | | | // rdar://9538608 llvm-svn: 133721
* Issue warning if weak_import attribute is added to an alreadyFariborz Jahanian2011-06-221-4/+9
| | | | | | declared variable and ignore it. // rdar://9538608 llvm-svn: 133654
* llvm-gcc treats a tentative definition with a previousFariborz Jahanian2011-06-201-0/+6
| | | | | | | | | (or follow up) extern declaration with weak_import as an actual definition. make clang follows this behavior. // rdar://9538608 llvm-gcc treats an extern declaration with weak_import llvm-svn: 133450
* When an explicit specialization has a storage specifier, error if thatDouglas Gregor2011-06-171-3/+12
| | | | | | | | | storage specifier is different from the storage specifier on the template. If that storage specifier is the same, then we only warn. Thanks to John for the prodding. llvm-svn: 133236
* Downgrade the error complaining about presence of a storage classDouglas Gregor2011-06-171-1/+1
| | | | | | | specifier on an explicit specialization to a warning, since neither EDG nor GCC diagnose this code as ill-formed. llvm-svn: 133232
OpenPOWER on IntegriCloud