summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix an edge case of mangling involving the combination of a lambda and typeid.Eli Friedman2012-09-261-1/+2
| | | | | | | | | | | | | typeid (and a couple other non-standard places where we can transform an unevaluated expression into an evaluated expression) is special because it introduces an an expression evaluation context, which conflicts with the mechanism to compute the current lambda mangling context. PR12123. I would appreciate if someone would double-check that we get the mangling correct with this patch. llvm-svn: 164658
* Fix some dead stores which the static analyzer warned about. No functionalityRichard Smith2012-09-141-2/+4
| | | | | | change (the problematic cases in ParseDecl.cpp are currently impossible). llvm-svn: 163920
* Improved MSVC __interface support by adding first class support for it, ↵Joao Matos2012-08-311-0/+7
| | | | | | instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. llvm-svn: 163013
* Now that ASTMultiPtr is nothing more than a array reference, make it a ↵Benjamin Kramer2012-08-231-3/+1
| | | | | | | | MutableArrayRef. This required changing all get() calls to data() and using the simpler constructors. llvm-svn: 162501
* Remove ASTOwningVector, it doesn't own anything and provides no value over ↵Benjamin Kramer2012-08-231-7/+7
| | | | | | SmallVector. llvm-svn: 162492
* Rip out remnants of move semantic emulation and smart pointers in Sema.Benjamin Kramer2012-08-231-1/+1
| | | | | | | These were nops for quite a while and only lead to confusion. ASTMultiPtr now behaves like a proper dumb array reference. llvm-svn: 162475
* Use LLVM_BUILTIN_TRAP instead of lame volatile int traps.David Blaikie2012-08-211-1/+1
| | | | | | (from a todo mentioned in r159469 & originally suggested by Chandler Carruth) llvm-svn: 162302
* Thread-safety analysis: fix scoping issues related to 'this', including anDeLesley Hutchins2012-08-201-29/+34
| | | | | | ICE in friend functions. llvm-svn: 162229
* PR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers andRichard Smith2012-08-181-3/+11
| | | | | | | | | | | | | | | | | nested names as id-expressions, using the annot_primary_expr annotation, where possible. This removes some redundant lookups, and also allows us to typo-correct within tentative parsing, and to carry on disambiguating past an identifier which we can determine will fail lookup as both a type and as a non-type, allowing us to disambiguate more declarations (and thus offer improved error recovery for such cases). This also introduces to the parser the notion of a tentatively-declared name, which is an identifier which we *might* have seen a declaration for in a tentative parse (but only if we end up disambiguating the tokens as a declaration). This is necessary to correctly disambiguate cases where a variable is used within its own initializer. llvm-svn: 162159
* Add support for "type safety" attributes that allow checking that 'void *'Dmitri Gribenko2012-08-171-1/+69
| | | | | | | | | | | | | | function arguments and arguments for variadic functions are of a particular type which is determined by some other argument to the same function call. Usecases include: * MPI library implementations, where these attributes enable checking that buffer type matches the passed MPI_Datatype; * for HDF5 library there is a similar usecase as MPI; * checking types of variadic functions' arguments for functions like fcntl() and ioctl(). llvm-svn: 162067
* Thread safety analysis: prevent a compiler error in cases where aDeLesley Hutchins2012-08-151-1/+2
| | | | | | late-parsed attribute is attached to an invalid declaration. llvm-svn: 161997
* objective-C++: Delayed parsing of most commonFariborz Jahanian2012-08-101-14/+1
| | | | | | | member functions defined inside an objc class implementation. wip. llvm-svn: 161667
* Minor simplification for r161534.Eli Friedman2012-08-081-2/+1
| | | | llvm-svn: 161544
* Fix r161534 so it actually builds.Eli Friedman2012-08-081-2/+1
| | | | llvm-svn: 161539
* Handle deprecation diagnostics correctly for C struct fields and Objective-C ↵Eli Friedman2012-08-081-8/+9
| | | | | | properties/ivars. <rdar://problem/6642337>. llvm-svn: 161534
* Improvements to vexing-parse warnings. Make the no-parameters case moreRichard Smith2012-07-301-10/+8
| | | | | | | | | | | | | accurate by asking the parser whether there was an ambiguity rather than trying to reverse-engineer it from the DeclSpec. Make the with-parameters case have better diagnostics by using semantic information to drive the warning, improving the diagnostics and adding a fixit. Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for declarations of the form 'T (*x)(...)', which seem to have a very high false positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'. llvm-svn: 160998
* Fix an assertion failure when code completing an auto variable's initialiser.Peter Collingbourne2012-07-271-0/+1
| | | | llvm-svn: 160857
* Pedantic -pedantic correction. Duplicate cv-qualifiers are permitted in C++11Richard Smith2012-07-241-6/+6
| | | | | | unless they appear in a decl-specifier-seq. llvm-svn: 160688
* Fix a typo (the the => the)Sylvestre Ledru2012-07-231-1/+1
| | | | llvm-svn: 160622
* Add diagnostics for comma at end of enum and for extra semicolon at namespaceRichard Smith2012-07-231-4/+4
| | | | | | | | scope to -Wc++11-extensions. Move extra semicolon after member function definition diagnostic out of -pedantic, since C++ allows a single semicolon there. Keep it in -Wextra-semi, though, since it's still questionable. llvm-svn: 160618
* Fixes an ObjC++ parse crash caused by delayed parsingFariborz Jahanian2012-07-201-1/+4
| | | | | | | | of c-functions nested in namespace in method implementations by turning off its delayed parsing until a proper solution is figured out. pr13418 llvm-svn: 160552
* Better parser recovery in Objective-C containers.Jordan Rose2012-07-091-4/+22
| | | | | | | | | | | | | | Previously it was possible to get an infinite-loop-on-invalid with a namespace decl within @interface. Since 'namespace' is normally a safe place to retry top-level parsing, we just didn't consume the token. This adds a flag that tracks whether we have temporarily left Objective-C scope to parse a C-like declaration, and uses that to better recover from parse problems by stopping at possible method declarations and at @end. To fix the original problem, we do /not/ stop at 'namespace' when in an Objective-C @interface or @protocol context (but still do in @implementation). llvm-svn: 159941
* objective-c++ parsing. Turn off delayed parsingFariborz Jahanian2012-07-051-1/+3
| | | | | | | | | of out-of-line c++ method definition which happens to be inside an objc class implementation until I can figure out how to do it. This is to fix a broken project. llvm-svn: 159772
* Obj-C++11 parser: handle a fall out of delayed Fariborz Jahanian2012-07-031-1/+1
| | | | | | | c-function parsing when a declaration with C++0x braced-init-list is inside an @implementation. llvm-svn: 159693
* Obj-C++11 parser: fix broken parsing of c-functionFariborz Jahanian2012-07-031-4/+3
| | | | | | defined in class implementations. llvm-svn: 159691
* Obj-C++11 parser: turn off buffering ofFariborz Jahanian2012-07-031-1/+3
| | | | | | | c-function defined in objc class implementation for now. llvm-svn: 159690
* objective-c: just as we have done for method definitions,Fariborz Jahanian2012-07-021-0/+8
| | | | | | | | c-functions declared in implementation should have their parsing delayed until the end so, they can access forward declared private methods. // rdar://10387088 llvm-svn: 159626
* A ':' after an enum-specifier at class scope is a bitfield, not a typo for a ↵Richard Smith2012-07-021-3/+6
| | | | | | ';'. llvm-svn: 159549
* Add support for the C11 _Alignof keyword.Jordan Rose2012-06-301-1/+1
| | | | | | | This behaves like the existing GNU __alignof and C++11 alignof keywords; most of the patch is simply adding the third token spelling to various places. llvm-svn: 159494
* Use -frewrite-includes for crash reports.David Blaikie2012-06-291-0/+2
| | | | | | | | | | | In future changes we should: * use __builtin_trap rather than derefing 'random' volatile pointers. * avoid dumping temporary files into /tmp when running tests, instead preferring a location that is properly cleaned up by lit. Review by Chandler Carruth. llvm-svn: 159469
* Whitespace.Chad Rosier2012-06-261-147/+147
| | | | llvm-svn: 159235
* Extend the "expected ';' after struct" logic to also apply to enums, and toRichard Smith2012-06-251-4/+23
| | | | | | struct and enum forward-declarations. llvm-svn: 159164
* Recognize GNU attributes after 'enum class'. Fixes the libc++ build.John McCall2012-06-231-1/+8
| | | | llvm-svn: 159089
* Clean up a large number of C++11 attribute parse issues, including parsingAlexis Hunt2012-06-231-18/+51
| | | | | | | | | | | | | | | | | | attributes in more places where we didn't and catching a lot more issues. This implements nearly every aspect of C++11 attribute parsing, except for: - Attributes are permitted on explicit instantiations inside the declarator (but not preceding the decl-spec) - Attributes are permitted on friend declarations of functions. - Multiple instances of the same attribute in an attribute-list (e.g. [[noreturn, noreturn]], not [[noreturn]] [[noreturn]] which is conforming) are allowed. The first two are marked as expected-FIXME in the test file and the latter is probably a defect and is currently untested. Thanks to Richard Smith for providing the lion's share of the testcases. llvm-svn: 159072
* Reapply r158700 and fixup patches, minus one hunk that slipped through andAlexis Hunt2012-06-191-2/+5
| | | | | | | caused a crash in an obscure case. On the plus side, it caused me to catch another bug by inspection. llvm-svn: 158767
* Reapplying the changes from r158717 as they were rolled back to avoid merge ↵Aaron Ballman2012-06-191-37/+143
| | | | | | conflicts from a separate problematic patch. llvm-svn: 158750
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-191-148/+39
| | | | | | | | The original r158700 caused crashes in the gcc test suite, g++.abi/vtable3a.C among others. It also caused failures in the libc++ test suite. llvm-svn: 158749
* Improves parsing and semantic analysis for MS __declspec attributes. This ↵Aaron Ballman2012-06-191-37/+143
| | | | | | includes support for the align (which fixes PR12631). llvm-svn: 158717
* Improve the specification of spellings in Attr.td.Alexis Hunt2012-06-191-2/+5
| | | | | | | | | | | | | | | | | Note that this is mostly a structural patch that handles the change from the old spelling style to the new one. One consequence of this is that all AT_foo_bar enum values have changed to not be based off of the first spelling, but rather off of the class name, so they are now AT_FooBar and the like (a straw poll on IRC showed support for this). Apologies for code churn. Most attributes have GNU spellings as a temporary solution until everything else is sorted out (such as a Keyword spelling, which I intend to add if someone else doesn't beat me to it). This is definitely a WIP. I've also killed BaseCheckAttr since it was unused, and I had to go through every attribute anyway. llvm-svn: 158700
* Handle C++11 attribute namespaces automatically.Alexis Hunt2012-06-181-11/+16
| | | | | | | | Now, as long as the 'Namespaces' variable is correct inside Attr.td, the generated code will correctly admit a C++11 attribute only when it has the appropriate namespace(s). llvm-svn: 158661
* [MSExtensions] Add support for __forceinline.Michael J. Spencer2012-06-181-3/+8
| | | | | | __forceinline is a combination of the inline keyword and __attribute__((always_inline)) llvm-svn: 158653
* Recover when correcting an unknown type name to a keyword like "struct".Kaelyn Uhrain2012-06-151-3/+7
| | | | llvm-svn: 158573
* If parsing a trailing-return-type fails, don't pretend we didn't have one atRichard Smith2012-06-121-2/+2
| | | | | | all. Suppresses follow-on errors mentioned in PR13074. llvm-svn: 158348
* Recognize the MS inheritance attributes and turn them into attributesJohn McCall2012-05-221-4/+0
| | | | | | | | | on the RecordDecl. Persist the MS portability type attributes and ignore them in Sema rather than the parser. Patch by João Matos! llvm-svn: 157288
* CXXThisScopeRAII objects aren't free, don't compute one if it's unused.Benjamin Kramer2012-05-171-1/+1
| | | | llvm-svn: 156987
* [libclang/AST] When declaring a local class, don't neglect to set the end ↵Argyrios Kyrtzidis2012-05-161-0/+1
| | | | | | | | | | | location of the DeclStmt node, otherwise libclang will not work for anything inside that class. rdar://10837710 llvm-svn: 156966
* Move the warnings for extra semi-colons under -Wextra-semi. Also, addedRichard Trieu2012-05-161-4/+2
| | | | | | | | a warning for an extra semi-colon after function definitions. Added logic so that a block of semi-colons on a line will only get one warning instead of a warning for each semi-colon. llvm-svn: 156934
* Typo.Richard Smith2012-05-151-1/+1
| | | | llvm-svn: 156860
* If we see a declaration which is either missing a type or has a malformed type,Richard Smith2012-05-151-1/+4
| | | | | | | | and the thing we have has a scope specifier, and we're in a context that doesn't allow declaring a qualified name, then the error is a malformed type, not a missing type. llvm-svn: 156856
* Don't use the implicit int rule for error recovery in C++. Instead, try toRichard Smith2012-05-151-5/+54
| | | | | | disambiguate whether the type name was forgotten or mistyped. llvm-svn: 156854
OpenPOWER on IntegriCloud