summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Reject incompatible redeclarations of extern C symbols.Rafael Espindola2013-01-111-8/+14
| | | | | | | Before we were only checking if the new declaration itself was marked extern C. Fixes prpr14766. llvm-svn: 172243
* Fixed an assertion failure triggered by invalid code.Enea Zaffanella2013-01-111-0/+4
| | | | | | | | Set invalid type of declarator after emitting error diagnostics, so that it won't be later considered when instantiating the template. Added test5_inst in test/SemaCXX/condition.cpp for non-regression. llvm-svn: 172201
* Truth in advertising: LocallyScopedExternalDecls actually only containsRichard Smith2013-01-102-18/+18
| | | | | | external declarations with C language linkage. llvm-svn: 172150
* [ms-inline asm] Extend the inline asm Sema lookup interface to determine if theChad Rosier2013-01-101-6/+10
| | | | | | | Decl is a VarDecl. Part of rdar://12991541 llvm-svn: 172120
* Provide a better warning when case value overflows.Fariborz Jahanian2013-01-101-2/+2
| | | | | | // rdar://11577384 llvm-svn: 172102
* Issue warning when case value is too large to fitFariborz Jahanian2013-01-091-1/+9
| | | | | | | | | in case condition type. // rdar://11577384. Test is conditionalized on x86_64-apple triple as I am not sure if the INT_MAX/LONG_MAX values in the test will pass this test for other hosts. llvm-svn: 172016
* When name lookup for a redeclaration finds declarations that are knownDouglas Gregor2013-01-091-0/+41
| | | | | | | | | | (because they are part of some module) but have not been made visible (because they are in a submodule that wasn't imported), filter out those declarations unless both the old declaration and the new declaration have external linkage. When one or both has internal linkage, there should be no conflict unless both are imported. llvm-svn: 171925
* put back diagnostics when flexible members are capturedFariborz Jahanian2013-01-091-1/+4
| | | | | | in lambdas. llvm-svn: 171921
* Fix typo (again).Fariborz Jahanian2013-01-081-1/+1
| | | | llvm-svn: 171917
* Remove lambda from my last patch.Fariborz Jahanian2013-01-081-4/+1
| | | | llvm-svn: 171915
* Fixes typo in comment.Fariborz Jahanian2013-01-081-1/+1
| | | | llvm-svn: 171913
* objectiveC blocks: It is impractical to capture Fariborz Jahanian2013-01-081-1/+16
| | | | | | | | struct variables with flexiable array members in blocks (and lambdas). Issue error instead of crashing in IRGen. // rdar://12655829 llvm-svn: 171912
* Clear LV cache when dropping availability attributes.Rafael Espindola2013-01-081-0/+6
| | | | llvm-svn: 171906
* Tighten types a bit. No functionality change.Rafael Espindola2013-01-082-12/+8
| | | | llvm-svn: 171902
* Don't crash when trying to apply the availability attribute to a block.Rafael Espindola2013-01-081-1/+6
| | | | llvm-svn: 171899
* Tighten types a bit. No functionality change.Rafael Espindola2013-01-082-6/+6
| | | | llvm-svn: 171894
* Move loop variable update.Rafael Espindola2013-01-081-2/+1
| | | | | | Thanks to Dmitri Gribenko for the suggestion. llvm-svn: 171889
* Mark all subsequent decls used.Rafael Espindola2013-01-082-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | In the source static void f(); static void f(); template<typename T> static void g() { f(); } static void f() { } void h() { g<int>(); } the call to f refers to the second decl, but it is only marked used at the end of the translation unit during instantiation, after the third f decl has been linked in. With this patch we mark all subsequent decls used, so that it is easy to check if a symbol is used or not. llvm-svn: 171888
* Use Decl::getAvailability() rather than checking for the "unavailable"Douglas Gregor2013-01-081-1/+2
| | | | | | | attribute when determining whether we need to see an implementation of a property. Fixes <rdar://problem/12958191>. llvm-svn: 171877
* Clear the LV cache when merging the availability attribute.Rafael Espindola2013-01-081-2/+6
| | | | | | | The availability implies default visibility, so it can change the computed visibility. llvm-svn: 171840
* Don't warn about undefined varargs argument behavior in unreachable code.Ted Kremenek2013-01-081-5/+5
| | | | | | Fixes <rdar://problem/12322000>. llvm-svn: 171831
* PR14838: When a member reference is bound to a temporary, don't forget toRichard Smith2013-01-081-2/+2
| | | | | | | perform the semantic checks associated with the destruction of that temporary. It'll be destroyed at the end of the constructor. llvm-svn: 171818
* Back out my no-op change from r171783.Douglas Gregor2013-01-081-8/+2
| | | | llvm-svn: 171817
* Use the C++11 POD definition in C++11 mode to determine whether oneDouglas Gregor2013-01-071-2/+8
| | | | | | can create a VLA of class type. Fixes <rdar://problem/12151822>. llvm-svn: 171783
* Use getter. Fixes the build from a bad merge.Rafael Espindola2013-01-071-1/+1
| | | | llvm-svn: 171782
* Add support for attribute((mode(unwind_word))).Rafael Espindola2013-01-071-0/+4
| | | | | | Patch by Nick Lewycky. Fixes pr8703. llvm-svn: 171781
* objective-C: when searching for declarations in protocolFariborz Jahanian2013-01-071-0/+5
| | | | | | | list of classes, etc., make sure to look into protocol definitions. // rdar://12958878 llvm-svn: 171777
* Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to beDavid Tweed2013-01-071-0/+5
| | | | | | | | | | with respect to the lower "left-hand-side bitwidth" bits, even when negative); see OpenCL spec 6.3j. This patch both implements this behaviour in the code generator and "constant folding" bits of Sema, and also prevents tests to detect undefinedness in terms of the weaker C99 or C++ specifications from being applied. llvm-svn: 171755
* Fixes a breakage in dejagnu++ test suite where it includedFariborz Jahanian2013-01-051-0/+1
| | | | | | | | <objc/Protocol.h>. Caused by my recent changes for various builtin declarations of objc_msgSendSuper variety. // rdar://12489098 llvm-svn: 171638
* Fix up various builtin declaration of objc_msgSend familiesFariborz Jahanian2013-01-041-0/+20
| | | | | | | to match those foung in objc.h an avoid spurious warnings. // rdar://12489098 llvm-svn: 171492
* Warn on unused auto variables.Rafael Espindola2013-01-031-2/+3
| | | | | | | | To do so we have to wait until we know that the type of a variable has been deduced. Sema::FinalizeDeclaration is the first callback that is used for decl with or without initializers. llvm-svn: 171458
* Use early returns to reduce indentation.Rafael Espindola2013-01-031-31/+34
| | | | llvm-svn: 171457
* Remove the anonymous namespace from lib/Sema/TreeTransform.hArgyrios Kyrtzidis2013-01-021-2/+0
| | | | llvm-svn: 171402
* s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few ↵Richard Smith2013-01-022-2/+2
| | | | | | nearby 'C++0x' comments. llvm-svn: 171372
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-0224-156/+156
| | | | llvm-svn: 171367
* Don't warn on unused member functions that are extern because of a typedef.Rafael Espindola2012-12-301-0/+3
| | | | llvm-svn: 171267
* Use hasCLanguageLinkage when warning about non C return types.Rafael Espindola2012-12-301-1/+1
| | | | llvm-svn: 171263
* Don't warn for undefined but used decls that are external because of a typedef.Rafael Espindola2012-12-291-0/+3
| | | | | | | | This fixes pr14736. It is fairly ugly, but I don't think we can do much better as we have to wait at least until the end of the typedef to know if the function will have external linkage or not. llvm-svn: 171240
* ArrayRefize CXXTryStmt.Nico Weber2012-12-291-1/+1
| | | | llvm-svn: 171239
* ArrayRefize a CompoundStmt constructor.Nico Weber2012-12-293-6/+7
| | | | llvm-svn: 171238
* Reject overloading of two static extern C functions.Rafael Espindola2012-12-282-29/+11
| | | | | | | | This patch moves hasCLanguageLinkage to be VarDecl and FunctionDecl methods so that they can be used from SemaOverload.cpp and then fixes the logic in Sema::IsOverload. llvm-svn: 171193
* Improve diagnostic wording for when an implicitly-deleted special memberRichard Smith2012-12-282-15/+6
| | | | | | function is selected by overload resolution. llvm-svn: 171190
* Implement dcl.link paragraph 5.Rafael Espindola2012-12-271-0/+40
| | | | | | | The language linkage of redeclarations must match. GCC was already reporting an error for this. llvm-svn: 171139
* Fix a regression from the previous commit.Rafael Espindola2012-12-261-1/+5
| | | | | | | Template instantiation can set the canonical decl to used after subsequent decls have been chained, so we have to check that too. llvm-svn: 171088
* Use the most recent redecl to decide if it is needed.Rafael Espindola2012-12-261-1/+1
| | | | | | This fixes pr14691, which I think is a regression from r168519. llvm-svn: 171077
* Fix for PR12222.Erik Verbruggen2012-12-252-7/+13
| | | | | | | | Changed getLocStart() and getLocEnd() to be required for Stmts, and make getSourceRange() optional. The default implementation for getSourceRange() is build the range by calling getLocStart() and getLocEnd(). llvm-svn: 171067
* Add intel_ocl_bicc calling convention as a function attribute to clang. The ↵Guy Benyei2012-12-252-1/+9
| | | | | | calling convention is already implemented in LLVM. llvm-svn: 171056
* Add 171048 back but invalidate the cache of all redeclarations when settingRafael Espindola2012-12-253-6/+20
| | | | | | | | | | | | | | | | | | the body of a functions. The problem was that hasBody looks at the entire chain and causes problems to -fvisibility-inlines-hidden if the cache was not invalidated. Original message: Cache visibility of decls. This unifies the linkage and visibility caching. I first implemented this when working on pr13844, but the previous fixes removed the performance advantage of this one. This is still a step in the right direction for making linkage and visibility cheap to use. llvm-svn: 171053
* Revert r171048, "Cache visibility of decls."NAKAMURA Takumi2012-12-253-20/+6
| | | | | | It broke stage2. llvm-svn: 171050
* Cache visibility of decls.Rafael Espindola2012-12-253-6/+20
| | | | | | | | | | | This unifies the linkage and visibility caching. I first implemented this when working on pr13844, but the previous fixes removed the performance advantage of this one. This is still a step in the right direction for making linkage and visibility cheap to use. llvm-svn: 171048
OpenPOWER on IntegriCloud