summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't accidentally and silently accept C++11 attributes in decl-specifier-seqsRichard Smith2013-02-221-1/+1
| | | | | | in C++98. llvm-svn: 175879
* Per the grammar in [dcl.dcl]p1, a simple-declaration can only have attributesRichard Smith2013-02-221-2/+3
| | | | | | if it has declarators. We were missing the check for this in a couple of places. llvm-svn: 175876
* Handle alignas(foo...) pack expansions.Richard Smith2013-02-221-10/+4
| | | | llvm-svn: 175875
* PR15311: Finish implementation of the suggested resolution of core issue 1488,Richard Smith2013-02-201-0/+7
| | | | | | | | which allows grouping parens in an abstract-pack-declarator. This was already mostly implemented, but missed some cases. Add an ExtWarn for use of this extension until CWG ratifies it. llvm-svn: 175660
* Process and handle attributes on conditions and for loop variables. Process andRichard Smith2013-02-201-1/+4
| | | | | | | diagnose attributes on alias declarations, using directives, and attribute declarations. llvm-svn: 175649
* Don't repeat the function name in the comment.Richard Smith2013-02-201-4/+4
| | | | llvm-svn: 175586
* PR15300: Support C++11 attributes on base-specifiers. We don't support any suchRichard Smith2013-02-191-0/+19
| | | | | | | | attributes yet, so just issue the appropriate diagnostics. Also generalize the fixit for attributes-in-the-wrong-place code and reuse it here, if attributes are placed after the access-specifier or 'virtual' in a base specifier. llvm-svn: 175575
* Accept over-qualified constructor in MSVC emulation modeDmitri Gribenko2013-02-121-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC accepts this: class A { A::A(); }; Clang accepts regular member functions with extra qualification as an MS extension, but not constructors. This changes the parser to defer rejecting qualified constructors so that the same Sema logic can apply to constructors as regular member functions. This also improves the error message when MS extensions are disabled (in my opinion). Before it was: /Users/jason/Desktop/test.cpp:2:8: error: expected member name or ';' after declaration specifiers A::A(); ~~~~ ^ 1 error generated. After: /Users/jason/Desktop/test.cpp:2:6: error: extra qualification on member 'A' A::A(); ~~~^ 1 error generated. Patch by Jason Haslam. llvm-svn: 174980
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-081-3/+4
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* Thread safety analysis: make sure that expressions in attributes are parsedDeLesley Hutchins2013-02-071-0/+1
| | | | | | in an unevaluated context. llvm-svn: 174644
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-071-0/+7
| | | | | | restrictions. llvm-svn: 174601
* Downgrade 'attribute ignored when parsing type' from error to warning, to matchRichard Smith2013-01-291-1/+1
| | | | | | | | | 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-291-0/+3
| | | | llvm-svn: 173779
* 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-281-2/+7
| | | | | | | | | | 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
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-201-0/+7
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* Parsing support for C11's _Noreturn keyword. No semantics yet.Richard Smith2013-01-171-0/+6
| | | | llvm-svn: 172761
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-171-0/+2
| | | | | | | | 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
* *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-121-1/+1
| | | | | | 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
* PR14855: don't silently swallow a nested-name-specifier after a type name.Richard Smith2013-01-081-1/+5
| | | | llvm-svn: 171908
* s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few ↵Richard Smith2013-01-021-12/+12
| | | | | | nearby 'C++0x' comments. llvm-svn: 171372
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-17/+17
| | | | llvm-svn: 171367
* 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
* Use the MaybeParseMicrosoftAttributes function.Chad Rosier2012-12-201-2/+1
| | | | llvm-svn: 170761
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-201-8/+8
| | | | | | which is wrong here. llvm-svn: 170721
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-8/+8
| | | | | | single attribute in the future. llvm-svn: 170500
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-181-0/+48
| | | | | | 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-181-48/+0
| | | | | | these files to Windows style. llvm-svn: 170431
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-181-0/+48
| | | | llvm-svn: 170428
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-3/+3
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Don't include Type.h in DeclarationName.h.Benjamin Kramer2012-12-011-0/+1
| | | | | | Recursively prune some includes. llvm-svn: 169094
* Improve diagnostic on C++11 attribute specifiers that appear at wrong ↵Michael Han2012-11-261-5/+32
| | | | | | | | | | | | | syntactic locations around class specifiers. This change list implemented logic that explicitly detects several combinations of locations where C++11 attribute specifiers might be incorrectly placed within a class specifier. Previously we emit generic diagnostics like "expected identifier" for such cases; now we emit specific diagnostic against the misplaced attributes, this also fixed a bug in old code where attributes appear at legitimate locations were incorrectly rejected. Thanks to Richard Smith for reviewing! llvm-svn: 168626
* Made the "expected string literal" diagnostic more expressiveAndy Gibbs2012-11-171-1/+2
| | | | llvm-svn: 168267
* Accept and pass arguments to __unknown_anytype in argumentJohn McCall2012-11-141-0/+6
| | | | | | | | | | | | | | | | | | | | | positions of Objective-C methods. It is possible to recover a lot of type information about Objective-C methods from the reflective metadata for their implementations. This information is not rich when it comes to struct types, however, and it is not possible to produce a type in the debugger's round-tripped AST which will really do anything useful during type-checking. Therefore we allow __unknown_anytype in these positions, which essentially disables type-checking for that argument. We infer the parameter type to be the unqualified type of the argument expression unless that expression is an explicit cast, in which case it becomes the type-as-written of that cast. rdar://problem/12565338 llvm-svn: 167896
* Teach Clang parser to reject C++11 attributes that appertain to declaration ↵Michael Han2012-11-061-1/+19
| | | | | | | | | specifiers. We don't support any C++11 attributes that appertain to declaration specifiers so reject the attributes in parser until we support them; this also conforms to what g++ 4.8 is doing. llvm-svn: 167481
* Thread safety analysis: Fixed ICE caused by double delete when late parsedDeLesley Hutchins2012-11-021-2/+5
| | | | | | attributes are attached to function declarations nested inside a class method. llvm-svn: 167321
* Change diagnostics for enums with fixed underlying type so in C++98 mode, we ↵Eli Friedman2012-11-021-4/+7
| | | | | | cite C++11. llvm-svn: 167273
* 'constexpr' and 'friend' are both declaration specifiers. Teach the parser ↵Richard Smith2012-10-251-3/+5
| | | | | | this, for better error recovery. llvm-svn: 166645
* DR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.Richard Smith2012-10-171-6/+6
| | | | llvm-svn: 166152
* Fixed FunctionTypeLoc range for trailing return type.Abramo Bagnara2012-10-151-3/+10
| | | | llvm-svn: 165974
* Fix a crash-on-invalid when parsing a reference to an invalid auto declarationDavid Blaikie2012-10-101-0/+1
| | | | | | | | | auto x((unknown)); int& y = x; would crash because we were not flagging 'x' as an invalid declaration here. llvm-svn: 165675
* Fixed FunctionTypeLoc source range.Abramo Bagnara2012-10-041-9/+16
| | | | llvm-svn: 165259
* Fix scope location when parsing GNU attributes.Michael Han2012-10-041-4/+5
| | | | | | | | For GNU attributes, instead of reusing attribute source location for the scope location, use SourceLocation() since GNU attributes don not have scope tokens. llvm-svn: 165234
* Improve C++11 attribute parsing.Michael Han2012-10-031-8/+15
| | | | | | | | - General C++11 attributes were previously parsed and ignored. Now they are parsed and stored in AST. - Add support to parse arguments of attributes that in 'gnu' namespace. - Differentiate unknown attributes and known attributes that can't be applied to statements when emitting diagnostic. llvm-svn: 165082
OpenPOWER on IntegriCloud