summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
* Micro change: moved '{' for better readability (+don't confuse ↵Alexander Kornienko2013-02-011-5/+5
| | | | | | -Wimplicit-fallthrough) llvm-svn: 174202
* Provide a fixit for constexpr non-static data members.David Blaikie2013-01-301-3/+3
| | | | | | | | | | | | | | | | If the member has an initializer, assume it was probably intended to be static and suggest/recover with that. If the member doesn't have an initializer, assume it was probably intended to be const instead of constexpr and suggest that. (if the attempt to apply these changes fails, don't make any suggestion & produce the same diagnostic experience as before. The only case where this can come up that I know of is with a mutable constexpr with an initializer, since mutable is incompatible with static (but it's already incompatible with const anyway)) llvm-svn: 173873
* Produce a diagnostic if alignas is applied to an expression. Neither C11 norRichard Smith2013-01-291-3/+6
| | | | | | C++11 allows that. llvm-svn: 173789
* Downgrade 'attribute ignored when parsing type' from error to warning, to matchRichard Smith2013-01-292-4/+4
| | | | | | | | | the diagnostic's warn_ name. Switch some places (notably C++11 attributes) which really wanted an error over to a different diagnostic. Finally, suppress the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing diagnostics in important system headers. llvm-svn: 173788
* Implement C++11 [dcl.align]p1 and C11 6.7.5/2 rules for alignas and _Alignas.Richard Smith2013-01-292-7/+15
| | | | llvm-svn: 173779
* PR15017: A '>' can appear after a type-specifier in a template-argument-list.Richard Smith2013-01-291-0/+3
| | | | | | | It turns out that there's no correctness bug here (because we can't have a type definition in this location), but there was a diagnostic bug. llvm-svn: 173766
* Treat alignas and _Alignas as keyword attributes. This allows us toRichard Smith2013-01-291-10/+6
| | | | | | | pretty-print them properly (modulo the more general badness in alignment attribute printing). llvm-svn: 173752
* Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelledRichard Smith2013-01-291-5/+7
| | | | | | | | | as a keyword. Rationalize existing attributes to use it as appropriate, and to not lie about some __declspec attributes being GNU attributes. In passing, remove a gross hack which was discarding attributes which we could handle. This results in us actually respecting the __pascal keyword again. llvm-svn: 173746
* Finish semantic analysis for [[carries_dependency]] attribute.Richard Smith2013-01-285-7/+14
| | | | | | | | | | This required plumbing through a new flag to determine whether a ParmVarDecl is actually a parameter of a function declaration (as opposed to a function typedef etc, where the attribute is prohibited). Weirdly, this attribute (just like [[noreturn]]) cannot be applied to a function type, just to a function declaration (and its parameters). llvm-svn: 173726
* Give a more informative error message when the dot or arrow operator is usedRichard Trieu2013-01-261-3/+6
| | | | | | | on a type. Currently, it gives a generic "expected unqualified-id" error. The new error message is "cannot use (dot|arrow) operator on a type". llvm-svn: 173556
* [ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag. MS-styleChad Rosier2013-01-221-15/+0
| | | | | | inline assembly can be enable with -fasm-blocks or -fms-extensions alone. llvm-svn: 173186
* objectiveC (take two): don't warn when in -Wselector mode andFariborz Jahanian2013-01-221-24/+5
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173179
* [ms-inline asm] Remove a warning about ms-style inline assembly not beingChad Rosier2013-01-221-3/+0
| | | | | | supported. llvm-svn: 173177
* objectiveC: don't warn when in -Wselector mode andFariborz Jahanian2013-01-211-3/+22
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173097
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-203-0/+9
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* Fix five more cases of tokens which can legally follow a type specifier.Richard Smith2013-01-191-2/+13
| | | | llvm-svn: 172886
* Fix parsing of class specifiers before '\n' 'operator'.Nico Weber2013-01-181-0/+1
| | | | | | | | | | | | | r159549 / r159164 regressed clang to reject struct s {}; struct s operator++(struct s a) { return a; } This fixes the regression. Richard, pleas check if this looks right. llvm-svn: 172834
* Parsing support for C11's _Noreturn keyword. No semantics yet.Richard Smith2013-01-171-0/+6
| | | | llvm-svn: 172761
* ArrayRef-ize some ctor initializer related APIsDavid Blaikie2013-01-171-2/+1
| | | | llvm-svn: 172701
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-173-2/+12
| | | | | | | | it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). llvm-svn: 172691
* PR14918: Don't confuse braced-init-lists after template variable declarationsRichard Smith2013-01-151-27/+17
| | | | | | | | | | | with function definitions. We really should remove Parser::isDeclarationAfterDeclarator entirely, since it's meaningless in C++11 (an open brace could be either a function definition or an initializer, which is what it's trying to differentiate between). The other caller of it happens to be correct right now... llvm-svn: 172510
* Refactor to call ActOnFinishFullExpr on every full expression. TeachRichard Smith2013-01-142-5/+7
| | | | | | | | ActOnFinishFullExpr that some of its checks only apply to discarded-value expressions. This adds missing checks for unexpanded variadic template parameter packs to a handful of constructs. llvm-svn: 172485
* *this is const in a trailing-return-type for a constexpr member function.Richard Smith2013-01-141-1/+3
| | | | llvm-svn: 172375
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-125-15/+15
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Pass false instead of 0 since isStar parameter of getArray has type bool. No ↵Nikola Smiljanic2013-01-111-1/+1
| | | | | | functionality change. llvm-svn: 172185
* Remove the unused Parser::ParseTranslationUnit functionHal Finkel2013-01-091-15/+0
| | | | | | | Parser::ParseTranslationUnit is now dead because the loop over ParseTopLevelDecl is in ParseAST. llvm-svn: 172005
* PR14855: don't silently swallow a nested-name-specifier after a type name.Richard Smith2013-01-081-1/+5
| | | | llvm-svn: 171908
* Tighten types a bit. No functionality change.Rafael Espindola2013-01-081-2/+2
| | | | llvm-svn: 171895
* Tighten types a bit. No functionality change.Rafael Espindola2013-01-081-1/+1
| | | | llvm-svn: 171894
* Add fixit hints for misplaced C++11 attributes around class specifiers.Michael Han2013-01-071-8/+45
| | | | | | | | | | Following r168626, in class declaration or definition, there are a combination of syntactic locations where C++11 attributes could appear, and among those the only valid location permitted by standard is between class-key and class-name. So for those attributes appear at wrong locations, fixit is used to move them to expected location and we recover by applying them to the class specifier. llvm-svn: 171757
* s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few ↵Richard Smith2013-01-028-49/+49
| | | | | | nearby 'C++0x' comments. llvm-svn: 171372
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-0210-59/+59
| | | | llvm-svn: 171367
* Remove some remnants of OwningExprResult / OwningStmtResult.Nico Weber2012-12-311-20/+17
| | | | | | | These got deleted late 2010 during the Actions/Sema unification. No functionality change. llvm-svn: 171269
* Simplify. No functionality change.Nico Weber2012-12-301-7/+2
| | | | llvm-svn: 171268
* Minor cleanup.Rafael Espindola2012-12-291-5/+1
| | | | | | | | DS parameter has a default (null) value anyway, so there's no need for an if/else here. Patch by Nikola Smiljanić. llvm-svn: 171210
* Remove unused arguments and rename to conform to coding standards.Chad Rosier2012-12-211-4/+4
| | | | llvm-svn: 170933
* Indent.Chad Rosier2012-12-211-2/+1
| | | | llvm-svn: 170925
* Remove unnecessary checks.Chad Rosier2012-12-211-6/+3
| | | | llvm-svn: 170924
* Fix indent.Chad Rosier2012-12-211-1/+1
| | | | llvm-svn: 170918
* Use the MaybeParseMicrosoftAttributes function.Chad Rosier2012-12-201-2/+1
| | | | llvm-svn: 170761
* Move operator precedence calculation to new headerDaniel Jasper2012-12-201-61/+0
| | | | | | | Thereby, it can be reused by clang-format and others. Review: http://llvm-reviews.chandlerc.com/D229 llvm-svn: 170757
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-203-13/+13
| | | | | | which is wrong here. llvm-svn: 170721
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-193-13/+13
| | | | | | single attribute in the future. llvm-svn: 170500
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-183-1/+61
| | | | | | Add OpenCL images as clang builtin types. llvm-svn: 170432
* Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei2012-12-183-1635/+1575
| | | | | | these files to Windows style. llvm-svn: 170431
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-183-1575/+1635
| | | | llvm-svn: 170428
* [parser] Push a semi token for recovery only when it is actually missing.Argyrios Kyrtzidis2012-12-171-7/+9
| | | | llvm-svn: 170363
* Don't require a space between the two ">" in "vector<id<protocol>>" in objc++11.Nico Weber2012-12-142-49/+59
| | | | | | | | C++11 allowed writing "vector<vector<int>>" without a space between the two ">". This change allows this for protocols in template lists too in -std=c++11 mode, and improves the diagnostic in c++98 mode. llvm-svn: 170223
* fix spelloNico Weber2012-12-141-1/+1
| | | | llvm-svn: 170176
* Use @import rather than @__experimental_modules_import, since theDouglas Gregor2012-12-112-2/+2
| | | | | | latter is rather a mess to type. llvm-svn: 169919
OpenPOWER on IntegriCloud