summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Add some support for diagnosing possibly mismatched constraint, type size andBill Wendling2012-10-251-0/+48
| | | | | | | modifiers. (From an idea by Eric...) <rdar://problem/12284092> llvm-svn: 166647
* PR14171: Don't crash if we hit one of the paths where GetFullTypeForDeclaratorRichard Smith2012-10-241-0/+15
| | | | | | rebuilds a function type, and that function type has parens around its name. llvm-svn: 166644
* Fix false positive in -Wunused-variable when a ctor call make involve cleanups.David Blaikie2012-10-241-0/+2
| | | | llvm-svn: 166625
* Use a .def file for most of the diagnostic options.Douglas Gregor2012-10-232-5/+3
| | | | llvm-svn: 166520
* Objective-C: check that when a category method is being implemented,Fariborz Jahanian2012-10-231-8/+20
| | | | | | | method type in cateogry matches the implementation. // rdar://12519216 llvm-svn: 166518
* Add a new warning -Wmissing-variable-declarations, to warn about variablesEli Friedman2012-10-232-0/+13
| | | | | | | | | defined without a previous declaration. This is similar to -Wmissing-prototypes, but for variables instead of functions. Patch by Ed Schouten. llvm-svn: 166498
* When rebuilding a DependentScopeDeclRefExpr, perform a lookup into the scopeRichard Smith2012-10-231-2/+6
| | | | | | even if it's dependent, in case it now names a member of the current instantiation. llvm-svn: 166496
* [ms-inline asm] Update for r166433.Chad Rosier2012-10-231-3/+8
| | | | llvm-svn: 166489
* [ms-inline-asm] Add handling for errors coming out of the backend.Eli Friedman2012-10-231-5/+46
| | | | llvm-svn: 166463
* Ugly ugly hack for libstdc++-4.6 and libstdc++-4.7 compatibility. TheseRichard Smith2012-10-231-0/+16
| | | | | | | | | | | | | | | | | libraries have an incorrect definition of std::common_type (inherited from a bug in the standard -- see LWG issue 2141), whereby they produce reference types when they should not. If we instantiate a typedef named std::common_type<...>::type, which is defined in a system header as decltype(... ? ... : ...), and the decltype produces a reference type, convert it to the non-reference type. (This doesn't affect any LWG2141-conforming implementation of common_type, such as libc++'s, because the default implementation of common_type<...>::type isn't supposed to produce a reference type.) This is horrible. I'm really sorry. :( Better ideas appreciated! llvm-svn: 166455
* Unrevert r166268, reverted in r166272, with a fix for the issue which NickRichard Smith2012-10-212-8/+50
| | | | | | | | | | | | | | | | | | | | | found: if an overloaded operator& is present before a template definition, the expression &T::foo is represented as a CXXOperatorCallExpr, not as a UnaryOperator, so we didn't notice that it's permitted to reference a non-static data member of an unrelated class. While investigating this, I discovered another problem in this area: we are treating template default arguments as unevaluated contexts during substitution, resulting in performing incorrect checks for uses of non-static data members in C++11. That is not fixed by this patch (I'll look into this soon; it's related to the failure to correctly instantiate constexpr function templates), but was resulting in this bug not firing in C++11 mode (except with -Wc++98-compat). Original message: PR14124: When performing template instantiation of a qualified-id outside of a class, diagnose if the qualified-id instantiates to a non-static class member. llvm-svn: 166385
* Move private classes into anonymous namespaces.Benjamin Kramer2012-10-201-0/+4
| | | | llvm-svn: 166377
* Rework implementation of DR1492: Apply the resolution to operator delete too,Richard Smith2012-10-204-35/+52
| | | | | | | | | | | | since it also has an implicit exception specification. Downgrade the error to an extwarn, since at least for operator delete, system headers like to declare it as 'noexcept' whereas the implicit definition does not have an explicit exception specification. Move the exception specification for user-declared 'operator delete' functions from the type-as-written into the type, to reflect reality and to allow us to detect whether there was an implicit exception spec or not. llvm-svn: 166372
* Fix __builtin_va_arg assertion failure in ARM AAPCS.Logan Chien2012-10-201-0/+10
| | | | llvm-svn: 166369
* DR1472: A reference isn't odr-used if it has preceding initialization,Richard Smith2012-10-201-9/+10
| | | | | | | | | initialized by a reference constant expression. Our odr-use modeling still needs work here: we don't yet implement the 'set of potential results of an expression' DR. llvm-svn: 166361
* [ms-inline asm] Set the SemaCallback in the TargetAsmParser.Chad Rosier2012-10-191-1/+3
| | | | llvm-svn: 166310
* Clarify wording of -Wshift-op-parentheses.David Blaikie2012-10-191-5/+5
| | | | | | Suggestion from Matt Beaumont-Gay reviewing r165283. llvm-svn: 166296
* [ms-inline asm] Set the MCTargetAsmParser as paring MS-style inline asm.Chad Rosier2012-10-191-0/+1
| | | | llvm-svn: 166293
* Allow objc_requires_super to be used to check class methods as well.Jordan Rose2012-10-193-35/+22
| | | | | | | | | | | | | Also, unify ObjCShouldCallSuperDealloc and ObjCShouldCallSuperFinalize. The two have identical behavior and will never be active at the same time. There's one last simplification now, which is that if we see a call to [super foo] and we are currently in a method named 'foo', we will /unconditionally/ clear the ObjCShouldCallSuper flag, rather than check first to see if we're in a method where calling super is required. There's no reason to pay the extra lookup price here. llvm-svn: 166285
* Revert r166268, this fix for a crash-on-invalid introduced a rejects-valid.Nick Lewycky2012-10-192-38/+7
| | | | | | Richard has an unreduced testcase to work with. llvm-svn: 166272
* PR14124: When performing template instantiation of a qualified-id outside of aRichard Smith2012-10-192-7/+38
| | | | | | class, diagnose if the qualified-id instantiates to a non-static class member. llvm-svn: 166268
* Handle diamond inheritance in -Woverloaded-virtual.David Blaikie2012-10-191-13/+29
| | | | llvm-svn: 166254
* [ms-inline asm] Add a size argument to the LookupInlineAsmIdentifier() callback,Chad Rosier2012-10-181-3/+8
| | | | | | which will be used by the asm matcher in the near future. llvm-svn: 166221
* Fix Objective-C implicit property synthesis for C++ classes so we use valid Eli Friedman2012-10-182-40/+23
| | | | | | | | | | | source locations in places where it is necessary for diagnostics. By itself, this causes assertions, so while I'm here, also fix property synthesis for properties of C++ class type so we use so we properly set up a scope and mark variable declarations. <rdar://problem/12514189>. llvm-svn: 166219
* [ms-inline asm] Have the LookupInlineAsmIdentifier() callback function return aChad Rosier2012-10-181-19/+17
| | | | | | | *NamedDecl. In turn, build the expressions after we're finished parsing the asm. This avoids a crasher if the lookup fails. llvm-svn: 166213
* Factor CollectClassPropertyImplementations out of Sema into ASTAnna Zaks2012-10-181-42/+12
| | | | | | This would make it possible for the analyzer to use the function. llvm-svn: 166210
* From Vassil Vassilev: enable Sema to deal with multiple ExternalSemaSources.Axel Naumann2012-10-186-7/+306
| | | | llvm-svn: 166208
* DR1442: In a range-based for statement, namespace 'std' is not an associatedRichard Smith2012-10-182-17/+6
| | | | | | namespace. llvm-svn: 166194
* PR14021: Copy lookup results to ensure safe iteration.David Blaikie2012-10-181-2/+8
| | | | | | | | | | | | | | | | | Within the body of the loop the underlying map may be modified via Sema::AddOverloadCandidate -> Sema::CompareReferenceRelationship -> Sema::RequireCompleteType to avoid the use of invalid iterators the sequence is copied first. A reliable, though large, test case is available - it will be reduced and committed shortly. Patch by Robert Muth. Review by myself, Nico Weber, and Rafael Espindola. llvm-svn: 166188
* [ms-inline asm] Move most of the AsmParsing logic in clang back into the MCChad Rosier2012-10-181-180/+81
| | | | | | | layer. Use the new ParseMSInlineAsm() API and add an implementation of the MCAsmParserSemaCallback interface. llvm-svn: 166184
* Tests for DR1507.Richard Smith2012-10-181-1/+2
| | | | llvm-svn: 166162
* Update comment to match DR1502.Richard Smith2012-10-171-2/+1
| | | | llvm-svn: 166158
* Fix -Woverloaded-virtual when the using statement refers to a base ↵David Blaikie2012-10-171-1/+6
| | | | | | | | | | | | | | | declaration of a virtual function. GCC and Clang both do not warn on: struct a { virtual void func(); }; struct b: a { virtual void func(); void func(int); }; struct c: b { void func(int); using b::func; }; but if the "using" was using a::func GCC would still remain silent where Clang would warn. This change makes Clang consistent with GCC's existing behavior. llvm-svn: 166154
* DR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.Richard Smith2012-10-171-7/+5
| | | | llvm-svn: 166152
* Implement C++ 10.3p16 - overrides involving deleted functions must match.David Blaikie2012-10-171-11/+38
| | | | | | | Only deleted functions may override deleted functions and non-deleted functions may only override non-deleted functions. llvm-svn: 166082
* DR1492: In a definition of a destructor, the exception specification must beRichard Smith2012-10-161-16/+28
| | | | | | explicitly specified iff it was specified in the declaration. llvm-svn: 166071
* Add pnaclcall convention to Native Client targets.Derek Schuff2012-10-162-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Because PNaCl bitcode must be target-independent, it uses some different bitcode representations from other targets (e.g. byval and sret for structures). This means that without additional type information, it cannot meet some native ABI requirements for some targets (e.g. passing structures containing unions by value on x86-64). To allow generation of code which uses the correct native ABIs, we also support triples such as x86_64-nacl, which uses target-dependent IR (as opposed to le32-nacl, which uses byval and sret). To allow interoperation between the two types of code, this patch adds a calling convention attribute to be used in code compiled with the target-dependent triple, which will generate code using the le32-style bitcode. This calling convention does not need to be explicitly supported in the backend because it determines bitcode representation rather than native conventions (the backend just needs to undersand how to handle byval and sret for the Native Client OS). This patch implements __attribute__((pnaclcall)) to generate calls in bitcode according to the le32 bitcode conventions, an attribute which is accepted by any Native Client target, but issues a warning otherwise. llvm-svn: 166065
* [ms-inline asm] Move some logic around to simplify the interface between theChad Rosier2012-10-161-18/+32
| | | | | | front-end and the AsmParser. No functional change intended. llvm-svn: 166063
* Implement GCC's -Wint-to-pointer-cast.David Blaikie2012-10-161-0/+20
| | | | | | | | | | | | This implementation doesn't warn on anything that GCC doesn't warn on with the exception of templates specializations (GCC doesn't warn, Clang does). The specific skipped cases (boolean, constant expressions, enums) are open for debate/adjustment if anyone wants to demonstrate that GCC is being overly conservative here. The only really obvious false positive I found was in the Clang regression suite's MPI test - apparently MPI uses specific flag values in pointer constants. (eg: #define FOO (void*)~0) llvm-svn: 166039
* Minor tweak to last patch along with a test case.Fariborz Jahanian2012-10-161-1/+1
| | | | | | // rdar://12491143 llvm-svn: 166030
* fixes an objc crash involving objc bool literal onFariborz Jahanian2012-10-161-1/+1
| | | | | | | hopelessly poorly written code after spewing several errors. // rdar://12491143 llvm-svn: 166025
* Un-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.Daniel Dunbar2012-10-151-6/+2
| | | | llvm-svn: 165988
* Fixed CXXNamedCast right paren location propagation to instantiations.Abramo Bagnara2012-10-151-4/+1
| | | | llvm-svn: 165977
* Fixed LabelDecl source range.Abramo Bagnara2012-10-151-1/+3
| | | | llvm-svn: 165976
* Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.Nico Weber2012-10-151-2/+6
| | | | | | See PR14013. llvm-svn: 165962
* [ms-inline asm] Rework the front-end to use the API introduced in r165946.Chad Rosier2012-10-151-217/+179
| | | | | | | | | | | | | | | | | | | -The front-end now builds a single assembly string and feeds it to the AsmParser. The front-end iterates on a per statement basis by calling the ParseStatement() function. Please note, the calling of ParseStatement() and and any notion of MCAsmParsedOperands will be sunk into the MC layer in the near future. I plan to expose more basic APIs such as getClobbers, etc. -The enumeration of the AsmString expressions have been reworked to use SMLocs rather than assembly Pieces, which were being parsed in the front-end. -The test case, t8(), was modified due to r129223. I'll have to find a way to work around things such as these. Sorry for the large commit, but breaking this in multiple smaller commits proved too irritating. llvm-svn: 165957
* Update for r165858.Chad Rosier2012-10-131-3/+4
| | | | llvm-svn: 165859
* [ms-inline asm] Remove a bunch of parsing code from the front-end.Chad Rosier2012-10-121-21/+1
| | | | llvm-svn: 165851
* Make -mms-bitfields behave consistently.Eli Friedman2012-10-121-2/+2
| | | | | | Patch by Jeremiah Zanin. llvm-svn: 165849
* Update for r165833.Chad Rosier2012-10-121-9/+5
| | | | llvm-svn: 165834
OpenPOWER on IntegriCloud