summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo in comment.Nick Lewycky2011-05-121-1/+1
| | | | llvm-svn: 131212
* Fix PR9902: correctly substitute alias templates within the template in ↵Richard Smith2011-05-121-0/+3
| | | | | | which they are defined: provide an empty list of arguments for each containing template context during substitution. llvm-svn: 131211
* Implement CWG1170, which makes access-control errors into templateDouglas Gregor2011-05-112-3/+7
| | | | | | | argument deduction failures. Only implemented in C++0x, since this is a significant change in behavior from C++98/03. llvm-svn: 131209
* When checking for the necessary 'template<>' headers based on theDouglas Gregor2011-05-111-4/+10
| | | | | | | | | | nested of an out-of-line declaration, only require a 'template<>' header for each enclosing class template that hasn't been previously specialized; previously, we were requiring 'template<>' for enclosing class templates and members of class templates that hadn't been previously specialized. Fixes <rdar://problem/9422013>. llvm-svn: 131207
* Commit some missing changes to the previous patch.Alexis Hunt2011-05-112-4/+16
| | | | | | This means we get C++0x jump-across-intializer semantics correct. llvm-svn: 131204
* Implement implicit deletion of default constructors.Alexis Hunt2011-05-116-15/+193
| | | | | | | | Yes, I'm aware that the diagnostics are awful. Tests to follow. llvm-svn: 131203
* In Microsoft mode, allow conversion from pointer to integral type no matter ↵Francois Pichet2011-05-111-3/+5
| | | | | | | | | | | what size the integral type is. Necessary to parse MFC code. Example: void f(char *ptr) { char var = (char)ptr; } llvm-svn: 131201
* Implenment #pack pragma and ms_struct attribute layout.Fariborz Jahanian2011-05-111-1/+47
| | | | | | Concludes // radar://8823265. llvm-svn: 131188
* Teach CFG building how to deal with CXXMemberCallExprs and BoundMemberTy,John McCall2011-05-112-16/+18
| | | | | | | then teach -Wreturn-type to handle the same. Net effect: we now correctly handle noreturn attributes on member calls in the CFG. llvm-svn: 131178
* PR9882: Fix noexcept to deal with dependent new, delete, calls, andEli Friedman2011-05-111-17/+24
| | | | | | dynamic_cast correctly. llvm-svn: 131177
* In Microsoft mode, allow pure specifier (=0) on inline functions declared at ↵Francois Pichet2011-05-113-4/+21
| | | | | | | | | | | | | class scope. This removes 2 errors when parsing MFC code with clang Example: class A { virtual void f() = 0 { } } llvm-svn: 131175
* Use a heralded conversion to bool in inline-asm constraints.John McCall2011-05-101-1/+3
| | | | llvm-svn: 131170
* Fix crash in -Wuninitialized when using switch statments whose condition is ↵Ted Kremenek2011-05-101-5/+9
| | | | | | a logical operation. llvm-svn: 131158
* Re-do R131114 without breaking code.Alexis Hunt2011-05-103-14/+15
| | | | | | | | | I've edited one diagnostic which would print "copy constructor" for copy constructors and "constructor" for any other constructor. If anyone is extremely enamored with this, it can be reinstated with a simple boolean flag rather than calling getSpecialMember, which is inappropriate. llvm-svn: 131143
* Support pack pragma and ms_struct attributes. // rdar://8823265Fariborz Jahanian2011-05-101-0/+7
| | | | llvm-svn: 131142
* Elide __label__ declarations from the CFG. This resolves a crash in ↵Ted Kremenek2011-05-101-0/+5
| | | | | | CFGRecStmtDeclVisitor (crash in static analyzer). llvm-svn: 131141
* Reimplement Sema::MatchTemplateParametersToScopeSpecifier() based onDouglas Gregor2011-05-103-151/+278
| | | | | | | | | | | | | | | | | | the semantic context referenced by the nested-name-specifier rather than the syntactic form of the nested-name-specifier. The previous incarnation was based on my complete misunderstanding of C++ [temp.expl.spec]. The latest C++0x working draft clarifies the requirements here, and this rewrite is intended to follow that. Along the way, improve source location information in the diagnostics. For example, if we report that a specific type needs or doesn't need a 'template<>' header, we dig out that type in the nested-name-specifier and highlight its range. Fixes: PR5907, PR9421, PR8277, PR8708, PR9482, PR9668, PR9877, and <rdar://problem/9135379>. llvm-svn: 131138
* Don't strlen() every file before parsing it.Eli Friedman2011-05-101-1/+2
| | | | llvm-svn: 131132
* Revert 131114. This fixes PR9884.Rafael Espindola2011-05-102-11/+8
| | | | llvm-svn: 131126
* Further implement defaulting constructors.Alexis Hunt2011-05-102-151/+176
| | | | | | | | | | | | | Focus is on default constructors for the time being. Currently the exception specification and prototype are processed correctly. Codegen might work but in all likelihood doesn't. Note that due to an error, out-of-line defaulting of member functions is currently impossible. It will continue to that until I muster up the courage to admit that I secretly pray to epimetheus and that I need to rework the way default gets from Parse -> Sema. llvm-svn: 131115
* The last of the trivial constructor changes, make CXXSpecialMemberAlexis Hunt2011-05-102-8/+11
| | | | | | reflect our new, more accurate AST. llvm-svn: 131114
* Ignore const/volatile/restrict qualifiers on anonymous structs andDouglas Gregor2011-05-091-0/+18
| | | | | | unions. Fixes PR8326. llvm-svn: 131109
* Add a FIXME.Francois Pichet2011-05-091-0/+1
| | | | llvm-svn: 131108
* 'long long' requires special treatment in ms_structFariborz Jahanian2011-05-091-0/+10
| | | | | | structs (impacts 32-bit only though). llvm-svn: 131103
* Extend the tag-ambiguity hack I committed in r130810 for tagDouglas Gregor2011-05-091-4/+2
| | | | | | definitions to also include tag declarations. Fixes PR8151. llvm-svn: 131102
* Clean up trivial default constructors now.Alexis Hunt2011-05-095-24/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | hasTrivialDefaultConstructor() really really means it now. Also implement a fun standards bug regarding aggregates. Doug, if you'd like, I can un-implement that bug if you think it is truly a defect. The bug is that non-special-member constructors are never considered user-provided, so the following is an aggregate: struct foo { foo(int); }; It's kind of bad, but the solution isn't obvious - should struct foo { foo (int) = delete; }; be an aggregate or not? Lastly, add a missing initialization to FunctionDecl. llvm-svn: 131101
* When determining whether we need to instantiate a function type,Douglas Gregor2011-05-091-0/+6
| | | | | | | also consider whether any of the parameter types (as written, prior to decay) are dependent. Fixes PR9880 and <rdar://problem/9408413>. llvm-svn: 131099
* Rename "hasTrivialConstructor" to "hasTrivialDefaultConstructor" andAlexis Hunt2011-05-0915-57/+62
| | | | | | | modify the semantics slightly to accomodate default constructors (I hope). llvm-svn: 131087
* Driver/Darwin: Put dsymutil -o arguments first, so that dysmutil doesn't barfDaniel Dunbar2011-05-091-3/+3
| | | | | | | when POSIXLY_COMPLIANT is set. - Patch by Dave Vasilevsky! llvm-svn: 131084
* __builtin_va_list is void* on ARM, not char*.John McCall2011-05-091-1/+1
| | | | | | rdar://problem/9391966 llvm-svn: 131080
* Allow implicit conversion from function pointer to void* in Microsoft mode. Francois Pichet2011-05-081-0/+9
| | | | | | Necessary to parse MFC code. llvm-svn: 131076
* Move code to emit the callee of an CXXOperatorCallExpr out into a separate ↵Anders Carlsson2011-05-083-12/+137
| | | | | | function in CGClass.cpp llvm-svn: 131075
* Don't emit complete constructors for abstract classes. Also, don't emitAnders Carlsson2011-05-081-2/+9
| | | | | | | complete destructors for abstract classes unless the destructor is virtual and thus needs to be in the vtable. llvm-svn: 131068
* Look at all the record redeclaration when looking for a uuid attribute.Francois Pichet2011-05-081-4/+5
| | | | llvm-svn: 131066
* Relax the conversion rules for Objective-C GC qualifiers aDouglas Gregor2011-05-081-0/+7
| | | | | | | | | | | | | | | | | | | | | | bit by allowing __weak and __strong to be added/dropped as part of implicit conversions (qualification conversions in C++). A little history: GCC lets one add/remove/change GC qualifiers just about anywhere, implicitly. Clang did roughly the same before, but we recently normalized the semantics of qualifiers across the board to get a semantics that we could reason about (yay). Unfortunately, this tightened the screws a bit too much for GC qualifiers, where it's common to add/remove these qualifiers at will. Overall, we're still in better shape than we were before: we don't permit directly changing the GC qualifier (e.g., __weak -> __strong), so type safety is improved. More importantly, we're internally consistent in our handling of qualifiers, and the logic that allows adding/removing GC qualifiers (but not adding/removing address spaces!) only touches two obvious places. Fixes <rdar://problem/9402499>. llvm-svn: 131065
* In C++, allow us to emit a global as 'constant' even if it has classDouglas Gregor2011-05-071-7/+10
| | | | | | | type, so long as it is known to have a constant initializer and the class type is a POD class. Fixes <rdar://problem/9306265>. llvm-svn: 131060
* Revert r130717, which caused a regression (<rdar://problem/9402621>).Douglas Gregor2011-05-072-18/+4
| | | | llvm-svn: 131057
* Don't fail at parsing __declspec(property(get=get_func_name)). Just skip ↵Francois Pichet2011-05-071-0/+8
| | | | | | everything inside property() for now while we wait for the BoostPro people to provide a complete patch. llvm-svn: 131053
* PR9866: Fix the implementation of _mm_loadl_pd and _mm_loadh_pd to not makeEli Friedman2011-05-071-2/+2
| | | | | | bad assumptions about the alignment of the double* argument. llvm-svn: 131052
* Temporary preprocessor hack to get around the Microsoft __identifier(x) ↵Francois Pichet2011-05-071-0/+1
| | | | | | | | | | | extension. http://msdn.microsoft.com/en-us/library/hzc8ytsz(v=VS.100).aspx Microsoft doc claims this is a C++/CLI feature but it is really always enabled. This removes 2 error when parsing MFC code with clang. llvm-svn: 131051
* Add support for _if_exists and __if_not_exists at namespace/global scope.Francois Pichet2011-05-072-37/+87
| | | | llvm-svn: 131050
* Patch for PR 7409 - only error on definition of invalid typedefs. Suppress ↵Richard Trieu2011-05-071-3/+7
| | | | | | errors for additional uses of this invalid typedef. llvm-svn: 131043
* Implement a minor optimization by not introducing declarations intoDouglas Gregor2011-05-061-4/+4
| | | | | | DeclContext's lookup table when they aren't in any identifier namespace. llvm-svn: 131037
* When checking for a prior declaration of the name of a namespace, skipDouglas Gregor2011-05-061-4/+15
| | | | | | | | any names that aren't in the appropriate identifier namespaces. Fixes an embarrassing bug where we give a redefinition error due to an Objective-C category (<rdar://problem/9388207>). llvm-svn: 131036
* In ms_struct structs, Establish a new alignment for a Fariborz Jahanian2011-05-061-3/+7
| | | | | | non-bitfield following a bitfield if size of their types differ. llvm-svn: 131032
* Establish a new alignment for an ms_struct bitfield followingFariborz Jahanian2011-05-062-1/+16
| | | | | | a non-bitfield if size of their types differ. llvm-svn: 131023
* Keep track of the file ID corresponding to the original file used toDouglas Gregor2011-05-062-6/+18
| | | | | | | | | | | build a precompiled header. Use this information to eliminate the call to SourceManager::getLocation() while loading a precompiled preamble, since SourceManager::getLocation() itself causes unwanted deserialization. Fixed <rdar://problem/9399352>. llvm-svn: 131021
* Fix false positive warning about uninitialized variable.Cameron Esfahani2011-05-061-1/+1
| | | | llvm-svn: 131019
* Per Richard's suggestion, rename DefLoc to DefaultLoc where it appears.Alexis Hunt2011-05-064-29/+28
| | | | llvm-svn: 131018
* Add support for Microsoft __if_exists and __if_not_exists construct inside ↵Francois Pichet2011-05-062-0/+85
| | | | | | | | | | | | function definition. Allow to include or exclude code depending on if a symbol exists or not. Just like a #ifdef but for C/C++ symbols. More doc: http://msdn.microsoft.com/en-us/library/x7wy9xh3(v=VS.100).aspx Support at class and namespace scopes will be added later. llvm-svn: 131014
OpenPOWER on IntegriCloud