summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
...
* [OpenCL] Allow function declaration with empty argument list.Alexey Bader2017-10-111-1/+2
| | | | | | | | | | | | | | | | Treat 'f()' as 'f(void)' rather than a function w/o a prototype. Reviewers: Anastasia, yaxunl Reviewed By: Anastasia, yaxunl Subscribers: cfe-commits, echuraev, chapuni Differential Revision: https://reviews.llvm.org/D33681 Re-apply revision 306653. llvm-svn: 315453
* [Modules TS] Diagnose attempts to enter module implementation units without ↵Richard Smith2017-10-101-2/+2
| | | | | | the module interface being available. llvm-svn: 315381
* Remove unused variables. No functionality change.Benjamin Kramer2017-10-081-1/+0
| | | | llvm-svn: 315196
* [OPENMP] Allow use of declare target directive inside structAlexey Bataev2017-10-031-3/+11
| | | | | | | | | | declaration. Patch allows using of the `#pragma omp declare target`| `#pragma omp end declare target` directives inside the structures if we need to mark as declare target only some static members. llvm-svn: 314833
* [X86][MS-InlineAsm] Extended support for variables / identifiers on memory / ↵Coby Tayree2017-09-291-16/+10
| | | | | | | | | | | immediate expressions Allow the proper recognition of Enum values and global variables inside ms inline-asm memory / immediate expressions, as they require some additional overhead and treated incorrect if doesn't early recognized. supersedes D33278, D35774 Differential Revision: https://reviews.llvm.org/D37413 llvm-svn: 314494
* Properly parse a postfix expression following a Boolean literal. Fixes PR34273.Aaron Ballman2017-09-281-1/+2
| | | | | | Patch by Nicolas Lesser. llvm-svn: 314463
* Give external linkage and mangling to lambdas inside inline variables and ↵Richard Smith2017-09-221-29/+37
| | | | | | | | | | | variable templates. This implements the proposed approach in https://github.com/itanium-cxx-abi/cxx-abi/issues/33 This reinstates r313827, reverted in r313856, with a fix for the 'out-of-bounds enumeration value' ubsan error in that change. llvm-svn: 313955
* Revert "Give external linkage and mangling to lambdas inside inline ↵Vitaly Buka2017-09-211-37/+29
| | | | | | | | | | variables and variable templates." To fix: runtime error: load of value 15, which is not a valid value for type 'clang::LVComputationKind' This reverts commit r313827. llvm-svn: 313856
* Give external linkage and mangling to lambdas inside inline variables and ↵Richard Smith2017-09-201-29/+37
| | | | | | | | variable templates. This implements the proposed approach in https://github.com/itanium-cxx-abi/cxx-abi/issues/33 llvm-svn: 313827
* Recommit "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-084-0/+14
| | | | | | | | This is a recommit of r312781; in some build configurations variable names are omitted, so changed the new regression test accordingly. llvm-svn: 312794
* Fixed a crash in code completion.Ilya Biryukov2017-09-081-5/+17
| | | | | | | | | | | | | | Summary: The crash occured when FunctionDecl was parsed with an initializer. Reviewers: bkramer, klimek, francisco.lopes Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37382 llvm-svn: 312788
* Revert "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-084-14/+0
| | | | | | | The clang-with-lto-ubuntu bot didn't like the new regression test, revert while I investigate the issue. llvm-svn: 312784
* Add _Float16 as a C/C++ source language typeSjoerd Meijer2017-09-084-0/+14
| | | | | | | | | | | This adds _Float16 as a source language type, which is a 16-bit floating point type defined in C11 extension ISO/IEC TS 18661-3. In follow up patches documentation and more tests will be added. Differential Revision: https://reviews.llvm.org/D33719 llvm-svn: 312781
* Fix templated type alias completion when using global completion cacheErik Verbruggen2017-09-081-4/+5
| | | | | | | | | | | | | | | | | | | | | | | When we have enabled cache for global completions we did not have diagnostics for Bar and could not complete Ba as in provided code example. template <typename T> struct Foo { T member; }; template<typename T> using Bar = Foo<T>; int main() { Ba } (This is the fixed version of r 311442, which was reverted in r311445.) Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D35355 llvm-svn: 312780
* [OPENMP] Fix for PR34445: Reduction initializer segfaults at runtime inAlexey Bataev2017-09-061-5/+80
| | | | | | | | | | move constructor. Previously user-defined reduction initializer was considered as an assignment expression, not as initializer. Fixed this by treating the initializer expression as an initializer. llvm-svn: 312638
* std::function -> llvm::function_ref. NFC.Benjamin Kramer2017-09-011-1/+1
| | | | llvm-svn: 312336
* [c++2a] P0683R1: Permit default member initializers for bit-fields.Richard Smith2017-08-281-4/+5
| | | | | | | This would be trivial, except that our in-memory and serialized representations for FieldDecls assumed that this can't happen. llvm-svn: 311867
* [NFC] Remove a cstyle cast and replace some uses of Decl with NamedDecl ↵Faisal Vali2017-08-251-8/+8
| | | | | | during the processing of TemplateParameterLists. llvm-svn: 311788
* [Parser] Correct initalizer typos before lambda capture type is deduced.Volodymyr Sapsai2017-08-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | This is the same assertion as in https://reviews.llvm.org/D25206 that is triggered when RecordLayoutBuilder tries to compute the size of a field (for capture "typo_boo" in the test case) whose type hasn't been deduced. The fix is to add CorrectDelayedTyposInExpr call to the cases when we aren't disambiguating between an Obj-C message send and a lambda expression. rdar://problem/31760839 Reviewers: rsmith, ahatanak Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36853 llvm-svn: 311480
* Revert r311442 (Fix templated type alias completion when using global ↵Erik Verbruggen2017-08-221-7/+5
| | | | | | | | | | completion cache) Failing Tests (2): Clang :: CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp Clang :: SemaCXX/alias-template.cpp llvm-svn: 311445
* Fix templated type alias completion when using global completion cacheErik Verbruggen2017-08-221-5/+7
| | | | | | | | | | | | | | | | | | | | | When we have enabled cache for global completions we did not have diagnostics for Bar and could not complete Ba as in provided code example. template <typename T> struct Foo { T member; }; template<typename T> using Bar = Foo<T>; int main() { Ba } Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D35355 llvm-svn: 311442
* Fixed a crash on replaying Preamble's PP conditional stack.Ilya Biryukov2017-08-211-2/+0
| | | | | | | | | | | | | | | | | | | Summary: The crash occurs when the first token after a preamble is a macro expansion. Fixed by moving replayPreambleConditionalStack from Parser into Preprocessor. It is now called right after the predefines file is processed. Reviewers: erikjv, bkramer, klimek, yvvan Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36872 llvm-svn: 311330
* Allow pretty platform names in availability attributesAlex Lorenz2017-08-151-7/+12
| | | | | | rdar://32076651 llvm-svn: 310921
* Rename cxx1z -> cxx17 across all diagnostic IDs.Richard Smith2017-08-132-3/+3
| | | | llvm-svn: 310805
* PR34163: Don't cache an incorrect key function for a class if queried betweenRichard Smith2017-08-121-18/+5
| | | | | | | | | | | the class becoming complete and its inline methods being parsed. This replaces the hack of using the "late parsed template" flag to track member functions with bodies we've not parsed yet; instead we now use the "will have body" flag, which carries the desired implication that the function declaration *is* a definition, and that we've just not parsed its body yet. llvm-svn: 310776
* Place implictly declared functions at block scopeMomchil Velikov2017-08-1010-31/+48
| | | | | | | | | | | | Such implicitly declared functions behave as if the enclosing block contained the declaration extern int name() (C90, 6.3.3.2 Function calls), thus their names should have block scope (C90, 6.1.2.1 Scope of identifiers). This patch fixes https://bugs.llvm.org/show_bug.cgi?id=33224 Differential Revision: https://reviews.llvm.org/D33676 llvm-svn: 310616
* Update for llvm change.Rafael Espindola2017-08-021-2/+1
| | | | llvm-svn: 309885
* Recommit r308327 3rd time: Add a warning for missingAlex Lorenz2017-07-281-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files The second recommit (r309106) was reverted because the "non-default #pragma pack value chages the alignment of struct or union members in the included file" warning proved to be too aggressive for external projects like Chromium (https://bugs.chromium.org/p/chromium/issues/detail?id=749197). This recommit makes the problematic warning a non-default one, and gives it the -Wpragma-pack-suspicious-include warning option. The first recommit (r308441) caused a "non-default #pragma pack value might change the alignment of struct or union members in the included file" warning in LLVM itself. This recommit tweaks the added warning to avoid warnings for #includes that don't have any records that are affected by the non-default alignment. This tweak avoids the previously emitted warning in LLVM. Original message: This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 309386
* Revert r309106 "Recommit r308327 2nd time: Add a warning for missing"Hans Wennborg2017-07-261-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning fires on non-suspicious code in Chromium. Reverting until a solution is figured out. > Recommit r308327 2nd time: Add a warning for missing > '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files > > The first recommit (r308441) caused a "non-default #pragma pack value might > change the alignment of struct or union members in the included file" warning > in LLVM itself. This recommit tweaks the added warning to avoid warnings for > #includes that don't have any records that are affected by the non-default > alignment. This tweak avoids the previously emitted warning in LLVM. > > Original message: > > This commit adds a new -Wpragma-pack warning. It warns in the following cases: > > - When a translation unit is missing terminating #pragma pack (pop) directives. > - When entering an included file if the current alignment value as determined > by '#pragma pack' directives is different from the default alignment value. > - When leaving an included file that changed the state of the current alignment > value. > > rdar://10184173 > > Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 309186
* Recommit r308327 2nd time: Add a warning for missingAlex Lorenz2017-07-261-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files The first recommit (r308441) caused a "non-default #pragma pack value might change the alignment of struct or union members in the included file" warning in LLVM itself. This recommit tweaks the added warning to avoid warnings for #includes that don't have any records that are affected by the non-default alignment. This tweak avoids the previously emitted warning in LLVM. Original message: This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 309106
* [OPENMP] Initial support for 'in_reduction' clause.Alexey Bataev2017-07-211-10/+17
| | | | | | | Parsing/sema analysis for 'in_reduction' clause for task-based directives. llvm-svn: 308768
* Revert r308441 "Recommit r308327: Add a warning for missing '#pragma pack ↵Hans Wennborg2017-07-191-7/+2
| | | | | | | | | | | | | | | | | | | | | (pop)' and suspicious uses of '#pragma pack' in included files" This seems to have broken the sanitizer-x86_64-linux buildbot. Reverting until it's fixed, especially since this landed just before the 5.0 branch. > This commit adds a new -Wpragma-pack warning. It warns in the following cases: > > - When a translation unit is missing terminating #pragma pack (pop) directives. > - When entering an included file if the current alignment value as determined > by '#pragma pack' directives is different from the default alignment value. > - When leaving an included file that changed the state of the current alignment > value. > > rdar://10184173 > > Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 308455
* Recommit r308327: Add a warning for missing '#pragma pack (pop)'Alex Lorenz2017-07-191-2/+7
| | | | | | | | | | | | | | | | | | and suspicious uses of '#pragma pack' in included files This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 308441
* [OPENMP] Initial support for 'task_reduction' clause.Alexey Bataev2017-07-181-10/+13
| | | | | | Parsing/sema analysis of the 'task_reduction' clause. llvm-svn: 308352
* Revert r308327Alex Lorenz2017-07-181-7/+2
| | | | | | I forgot to test clang-tools-extra which is now failing. llvm-svn: 308328
* Add a warning for missing '#pragma pack (pop)' and suspicious usesAlex Lorenz2017-07-181-2/+7
| | | | | | | | | | | | | | | | | | of '#pragma pack' in included files This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 308327
* [index] Objective-C method declarations and message sends withAlex Lorenz2017-07-131-0/+4
| | | | | | | | an empty first selector piece should store the location of the first ':' rdar://33188656 llvm-svn: 307901
* fix typos in comments; NFCHiroshi Inoue2017-07-131-1/+1
| | | | llvm-svn: 307886
* Fix invalid warnings for header guards in preamblesErik Verbruggen2017-07-051-0/+2
| | | | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=33574 Differential Revision: https://reviews.llvm.org/D34882 llvm-svn: 307134
* [modules ts] Declarations from a module interface unit are only visible outsideRichard Smith2017-07-051-0/+2
| | | | | | the module if declared in an export block. llvm-svn: 307115
* Add a fixit for -Wobjc-protocol-property-synthesisAlex Lorenz2017-07-031-1/+1
| | | | | | | | rdar://32132756 Differential Revision: https://reviews.llvm.org/D34886 llvm-svn: 307014
* fix trivial typos in comments; NFCHiroshi Inoue2017-07-022-3/+3
| | | | llvm-svn: 306969
* [Modules] Implement ODR-like semantics for tag types in C/ObjCBruno Cardoso Lopes2017-07-012-9/+24
| | | | | | | | | | | | | | | | | | | | | | Allow ODR for ObjC/C in the sense that we won't keep more that one definition around (merge them). However, ensure the decl pass the structural compatibility check in C11 6.2.7/1, for that, reuse the structural equivalence checks used by the ASTImporter. Few other considerations: - Create error diagnostics for tag types mismatches and thread them into the structural equivalence checks. - Note that by doing this we only support redefinition between types that are considered "compatible types" by C. This is mixed approach of the suggestions discussed in http://lists.llvm.org/pipermail/cfe-dev/2017-March/053257.html Differential Revision: https://reviews.llvm.org/D31778 rdar://problem/31909368 llvm-svn: 306918
* [Parse] Use normalized attr name for late-parsing checks.George Burgess IV2017-06-301-8/+8
| | | | llvm-svn: 306899
* fix trivial typos, NFCHiroshi Inoue2017-06-301-1/+1
| | | | llvm-svn: 306789
* [Sema] Fix a crash-on-invalid when a template parameter list has a classAkira Hatanaka2017-06-263-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | definition or non-reference class type. The crash occurs when there is a template parameter list in a class that is missing the closing angle bracket followed by a definition of a struct. For example: class C0 { public: template<typename T, typename T1 = T // missing closing angle bracket struct S0 {}; C0() : m(new S0<int>) {} S0<int> *m; }; This happens because the parsed struct is added to the scope of the enclosing class without having its access specifier set, which results in an assertion failure in SemaAccess.cpp later. This commit fixes the crash by adding the parsed struct to the enclosing file scope and marking structs as invalid if they are defined in template parameter lists. rdar://problem/31783961 rdar://problem/19570630 Differential Revision: https://reviews.llvm.org/D33606 llvm-svn: 306317
* [Parser][ObjC] Use an artificial EOF token while parsing lexed ObjC methodsAlex Lorenz2017-06-191-1/+11
| | | | | | | | | | | This change avoid a crash that occurred when skipping to EOF while parsing an ObjC interface/implementation. rdar://31963299 Differential Revision: https://reviews.llvm.org/D34185 llvm-svn: 305719
* PR33318: Add missing full-expression checking to static_assert expression.Richard Smith2017-06-061-1/+3
| | | | | | | This fixes missing lambda-captures for variables referenced only inside a static_assert (!), among other things. llvm-svn: 304760
* Add support for #pragma clang sectionJaved Absar2017-06-051-0/+60
| | | | | | | | | | | | | | | This patch provides a means to specify section-names for global variables, functions and static variables, using #pragma directives. This feature is only defined to work sensibly for ELF targets. One can specify section names as: #pragma clang section bss="myBSS" data="myData" rodata="myRodata" text="myText" One can "unspecify" a section name with empty string e.g. #pragma clang section bss="" data="" text="" rodata="" Reviewers: Roger Ferrer, Jonathan Roelofs, Reid Kleckner Differential Revision: https://reviews.llvm.org/D33412 llvm-svn: 304705
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-031-0/+2
| | | | llvm-svn: 304646
OpenPOWER on IntegriCloud