summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser
Commit message (Collapse)AuthorAgeFilesLines
...
* PR20991: ::decltype is not valid.Richard Smith2014-10-041-0/+5
| | | | llvm-svn: 219043
* Revert r218925 - "Patch to warn if 'override' is missing"Alexander Potapenko2014-10-033-7/+6
| | | | | | | | | | | | | | | | | | | | This CL has caused bootstrap failures on Linux and OSX buildbots running with -Werror. Example report from http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/13183/steps/bootstrap%20clang/logs/stdio: ================================================================ [ 91%] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/ShowEnabledWarnings.cpp.o In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp:20: In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIISelLowering.h:19: /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIInstrInfo.h:71:8: error: 'getLdStBaseRegImmOfs' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] bool getLdStBaseRegImmOfs(MachineInstr *LdSt, ^ /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/include/llvm/Target/TargetInstrInfo.h:815:16: note: overridden virtual function is here virtual bool getLdStBaseRegImmOfs(MachineInstr *LdSt, ^ ================================================================ llvm-svn: 218969
* Patch to warn if 'override' is missingFariborz Jahanian2014-10-023-6/+7
| | | | | | | | | | | | for an overriding method if class has at least one 'override' specified on one of its methods. Reviewed by Doug Gregor. rdar://18295240 (I have already checked in all llvm files with missing 'override' methods and Bob Wilson has fixed a TableGen of FastISel so no warnings are expected from build of llvm after this patch. I have already verified this). llvm-svn: 218925
* Test case for my r218780 patch.Fariborz Jahanian2014-10-011-0/+5
| | | | | | | Suggested by Richard Smith. rdar://18508589. llvm-svn: 218830
* Suggest fix-it for missing '{' after base-clauseIsmail Pazarbasi2014-09-251-0/+15
| | | | llvm-svn: 218468
* PR18793: If we try to EnterTokenStream when our current lexer is a cachingRichard Smith2014-09-231-0/+5
| | | | | | | | | lexer, add the token buffer underneath the caching lexer where possible and push the tokens directly into the caching lexer otherwise. We previously put the lexer into a corrupted state where we could not guarantee to provide the tokens in the right order and would sometimes assert. llvm-svn: 218333
* ms-inline-asm: Scope inline asm labels to functionsEhsan Akhgari2014-09-221-0/+3
| | | | | | | | | | | | | | | | Summary: This fixes PR20023. In order to implement this scoping rule, we piggy back on the existing LabelDecl machinery, by creating LabelDecl's that will carry the "internal" name of the inline assembly label, which we will rewrite the asm label to. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4589 llvm-svn: 218230
* Don't crash on access decls with invalid scope specifier, PR20887.Nico Weber2014-09-101-0/+5
| | | | llvm-svn: 217472
* Add error, recovery and fixit for "~A::A() {...}".Richard Smith2014-09-061-0/+14
| | | | llvm-svn: 217302
* PR20760: Don't assert (and produce better diagnostics) if a default initializerRichard Smith2014-08-271-0/+11
| | | | | | contains an unmatched closing bracket token. llvm-svn: 216518
* revert patch r216469.Fariborz Jahanian2014-08-261-0/+1
| | | | llvm-svn: 216485
* c11- Check for c11 language option as documentation saysFariborz Jahanian2014-08-261-1/+0
| | | | | | | | feature is c11 about nested struct declarations must have struct-declarator-list. Without this change, code which was meant for c99 breaks. rdar://18125536 llvm-svn: 216469
* Move __vector long deprecation checking into DeclSpec::FinishHal Finkel2014-08-242-0/+10
| | | | | | | | | | | | __vector long is deprecated, but __vector long long is not. As a result, we cannot check for __vector long (to issue the deprecation warning) as we parse the type because we need to know how many 'long's we have first. DeclSpec::Finish seems like a more-appropriate place to perform the check (which places it with several other similar Altivec vector checks). Fixes PR20720. llvm-svn: 216342
* -fms-extensions: Alias _intNN to __intNNReid Kleckner2014-08-221-0/+5
| | | | | | | | | | Fixes build for SPEC 2000 CPU. MSVC disables these aliases under /Za, which enables stricter standards compliance. We don't currently have any way to disable them. Patch by Kevin Smith! llvm-svn: 216270
* Uniformed parsing of GNU attributes at line beginnning and added GNU ↵Abramo Bagnara2014-08-161-0/+10
| | | | | | attributes parsing FIXMEs. llvm-svn: 215814
* Sema: Permit nullptr template args in MSVC compat modeDavid Majnemer2014-08-141-1/+5
| | | | | | This fixes a regression I caused back in r211766. llvm-svn: 215609
* PR20634: add some more cases that can legitimately come after a struct ↵Richard Smith2014-08-133-0/+10
| | | | | | declaration to our list of special cases. llvm-svn: 215520
* Reject virt-specifiers on friend declarations. Give anonymous bitfields aRichard Smith2014-08-121-0/+10
| | | | | | location so their diagnostics have somewhere to point. llvm-svn: 215416
* Reject varargs '...' in function prototype if there are more parameters afterRichard Smith2014-08-112-2/+42
| | | | | | | | | | | it. Diagnose with recovery if it appears after a function parameter that was obviously supposed to be a parameter pack. Otherwise, warn if it immediately follows a function parameter pack, because the user most likely didn't intend to write a parameter pack followed by a C-style varargs ellipsis. This warning can be syntactically disabled by using ", ..." instead of "...". llvm-svn: 215408
* Sema: Handle declspecs without declarators in records properly in C modeDavid Majnemer2014-08-111-0/+1
| | | | | | | | | | | | | | | | | | | | | We had two bugs: - We wouldn't properly warn when a struct/union/enum was mentioned inside of a record definition if no declarator was provided. We should have mentioned that this declaration declares nothing. - We didn't properly support Microsoft's extension where certain declspecs without declarators would act as anonymous structs/unions. * We completely ignored the case where such a declspec could be a union. * We didn't properly handle the case where a record was defined inside another record: struct X { int a; struct Y { int b; }; }; llvm-svn: 215347
* Parser: Array decls with static but without array size are illformedDavid Majnemer2014-08-081-0/+1
| | | | | | | | | | | | Array declarators involving the static keyword take on two forms: D[ static type-qualifier-listopt assignment-expression ] D[ type-qualifier-list static assignment-expression ] Raise a diagnostic if the assignment-expression is missing. This fixes PR20584. llvm-svn: 215187
* A static_assert declaration cannot be a template; adding the diagnostic for ↵Aaron Ballman2014-08-041-0/+9
| | | | | | this instead of silently accepting and producing possibly-unexpected behavior. llvm-svn: 214770
* Add a state variable to the loop hint attribute.Tyler Nowicki2014-07-311-0/+3
| | | | | | | | | | This patch is necessary to support constant expressions which replaces the integer value in the loop hint attribute with an expression. The integer value was also storing the pragma’s state for options like vectorize(enable/disable) and the pragma unroll and nounroll directive. The state variable is introduced to hold the state of those options/pragmas. This moves the validation of the state (keywords) from SemaStmtAttr handler to the loop hint annotation token handler. Resubmit with changes to try to fix the build-bot issue. Reviewed by Aaron Ballman llvm-svn: 214432
* Revert r214333, "Add a state variable to the loop hint attribute."NAKAMURA Takumi2014-07-311-3/+0
| | | | | | It brought undefined behavior. llvm-svn: 214376
* Add a state variable to the loop hint attribute.Tyler Nowicki2014-07-301-0/+3
| | | | | | | | This patch is necessary to support constant expressions which replaces the integer value in the loop hint attribute with an expression. The integer value was also storing the pragma’s state for options like vectorize(enable/disable) and the pragma unroll and nounroll directive. The state variable is introduced to hold the state of those options/pragmas. This moves the validation of the state (keywords) from SemaStmtAttr handler to the loop hint annotation token handler. Reviewed by Aaron Ballman llvm-svn: 214333
* Fix default argument comma disambiguation bug following the 'template' keyword.Richard Smith2014-07-271-0/+6
| | | | llvm-svn: 214051
* Parse: Don't crash on trailing whitespace before EOFDavid Majnemer2014-07-261-0/+15
| | | | | | | | | | | | | | | Parser::ParseDeclarationSpecifiers eagerly updates the source range of the DeclSpec with the current token position. However, it might not consume any more tokens. Fix this by only setting the start of the range, not the end. This way the SourceRange will be invalid if we don't consume any more tokens. This fixes PR20413. Differential Revision: http://reviews.llvm.org/D4646 llvm-svn: 214018
* clang-cl: Merge adjacent single-line __asm blocksEhsan Akhgari2014-07-251-1/+1
| | | | | | | | | | | | | | | | | Summary: This patch extends the __asm parser to make it keep parsing input tokens as inline assembly if a single-line __asm line is followed by another line starting with __asm too. It also makes sure that we correctly keep matching braces in such situations by separating the notions of how many braces we are matching and whether we are in single-line asm block mode. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4598 llvm-svn: 213916
* Add support for #pragma nounroll.Mark Heffernan2014-07-241-0/+24
| | | | llvm-svn: 213885
* In unroll pragma syntax and loop hint metadata, change "enable" forms to a ↵Mark Heffernan2014-07-232-29/+30
| | | | | | new form using the string "full". llvm-svn: 213771
* Add support for '#pragma unroll'.Mark Heffernan2014-07-213-4/+106
| | | | llvm-svn: 213574
* Parse: Diagnose malformed 'message' arguments for 'availability' attrDavid Majnemer2014-07-181-0/+2
| | | | | | | The parsing code for 'availability' wasn't prepared for string literals like "a" L"b" showing up. Error if this occurs. llvm-svn: 213350
* Revert "clang/test/Driver/crash-report.c: This requires rewriter for ↵Alp Toker2014-07-165-5/+0
| | | | | | | | | | | | | | | | | | | | | -frewrite-includes. [PR20321]" We've decided to make the core rewriter class and PP rewriters mandatory. They're only a few hundred lines of code in total and not worth supporting as a distinct build configuration, especially since doing so disables key compiler features. This reverts commit r213150. Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter." This reverts commit r213148. Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/" This reverts commit r213146. llvm-svn: 213159
* clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.NAKAMURA Takumi2014-07-165-0/+5
| | | | llvm-svn: 213148
* Don't get confused on the number of braces when braces start after the first ↵Ehsan Akhgari2014-07-151-0/+3
| | | | | | | | | | | | | | | | __asm Summary: Without this, we would not consume the closing brace which would cause the parser to start consuming C++ and bad things would happen. Reviewers: majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4505 llvm-svn: 213032
* PR19751: (T())++ is not a cast-expression.Richard Smith2014-07-151-0/+6
| | | | llvm-svn: 213022
* Continue parsing an expression list even after an error is encountered.Kaelyn Takata2014-07-141-0/+6
| | | | | | | | | Otherwise, multiple errors such as having unknown identifiers for two arguments won't be diagnosed properly (e.g. only the first one would have a diagnostic message if typo correction fails even though both would be diagnosed if typo correction suggests a replacement). llvm-svn: 213003
* Giving this test a triple to satisfy the build bots.Aaron Ballman2014-07-061-1/+1
| | | | llvm-svn: 212418
* The MicrosoftExtensions.c test file should not rely on -x objective-c++. ↵Aaron Ballman2014-07-062-66/+53
| | | | | | Removed that from the RUN line, fixed obvious C++isms in the code, and moved some C++ tests into MicrosoftExtensions.cpp instead. As a drive-by, changed the line endings for MicrosoftExtensions.c to be LF instead of CRLF. llvm-svn: 212417
* This test case does not require -Wno-missing-declarations or -x objective-c++.Aaron Ballman2014-07-061-1/+1
| | | | llvm-svn: 212416
* Move InterlockedBitTestAndSet into its own test fileEhsan Akhgari2014-07-062-11/+13
| | | | | | | | | | | | | | Summary: This gives us back the test coverage we lost when I made MicrosoftExtensions.c x86-only. Reviewers: majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4401 llvm-svn: 212414
* Fix the MicrosoftExtensions.c targetEhsan Akhgari2014-07-061-0/+1
| | | | llvm-svn: 212393
* Enable the InterlockedBitTestAndSet testEhsan Akhgari2014-07-061-3/+0
| | | | llvm-svn: 212392
* Add support for nested blocks in Microsoft inline assemblyEhsan Akhgari2014-07-062-0/+20
| | | | | | This fixes http://llvm.org/PR20204. llvm-svn: 212389
* Don't allow dllimport variables in constant initializersHans Wennborg2014-06-251-1/+1
| | | | | | | | | | | | | | | | | This is a follow-up to David's r211677. For the following code, we would end up referring to 'foo' in the initializer for 'arr', and then fail to link, because 'foo' is dllimport and needs to be accessed through the __imp_?foo. __declspec(dllimport) extern const char foo[]; const char* f() { static const char* const arr[] = { foo }; return arr[0]; } Differential Revision: http://reviews.llvm.org/D4299 llvm-svn: 211736
* Fix parsing nested __if_exists blocksReid Kleckner2014-06-251-2/+16
| | | | | | | | | | | Rather than having kw___if_exists be a special case of ParseCompoundStatementBody, we can look for kw___if_exists in the big switch over for valid statement tokens in ParseStatementOrDeclaration. Nested __if_exists blocks are used in the DECLARE_REGISTRY_RESOURCEID macro from atlcom.h. llvm-svn: 211654
* Add a missing test for the __if_exists extensionReid Kleckner2014-06-251-0/+10
| | | | | | | MSVC does not create a new scope for the body of an __if_exists compound statement. Clang already gets this right today, but it was untested. llvm-svn: 211650
* Split tests for __if_exists out into their own fileReid Kleckner2014-06-252-97/+93
| | | | llvm-svn: 211649
* Provide a better diagnostic when braces are put before the identifier.Richard Trieu2014-06-242-0/+232
| | | | | | | | | | | | | | | | | When a user types: int [4] foo; assume that the user means: int foo[4]; Update the information for 'foo' to prevent additional errors, and provide a fix-it hint to move the brackets to the correct location. Additionally, suggest parens for types that require it, such as: int [4] *foo; to: int (*foo)[4]; llvm-svn: 211641
* Fix PR20081: Parsing templates in the presence of -x cuda -std=c++11Eli Bendersky2014-06-202-1/+22
| | | | | | http://reviews.llvm.org/D4222 llvm-svn: 211357
OpenPOWER on IntegriCloud