| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
c-function parsing when a declaration with
C++0x braced-init-list is inside an @implementation.
llvm-svn: 159693
|
|
|
|
|
|
| |
defined in class implementations.
llvm-svn: 159691
|
|
|
|
|
|
|
| |
c-function defined in objc class
implementation for now.
llvm-svn: 159690
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
';'.
llvm-svn: 159549
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 159235
|
|
|
|
|
|
| |
struct and enum forward-declarations.
llvm-svn: 159164
|
|
|
|
| |
llvm-svn: 159089
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
caused a crash in an obscure case. On the plus side, it caused me to catch
another bug by inspection.
llvm-svn: 158767
|
|
|
|
|
|
| |
conflicts from a separate problematic patch.
llvm-svn: 158750
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
includes support for the align (which fixes PR12631).
llvm-svn: 158717
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
__forceinline is a combination of the inline keyword and __attribute__((always_inline))
llvm-svn: 158653
|
|
|
|
| |
llvm-svn: 158573
|
|
|
|
|
|
| |
all. Suppresses follow-on errors mentioned in PR13074.
llvm-svn: 158348
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 156987
|
|
|
|
|
|
|
|
|
|
|
| |
location
of the DeclStmt node, otherwise libclang will not work for anything inside that
class.
rdar://10837710
llvm-svn: 156966
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 156860
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
disambiguate whether the type name was forgotten or mistyped.
llvm-svn: 156854
|
|
|
|
|
|
|
| |
parser, and use it to emit better diagnostics in cases where an identifer
can't be looked up as a type name.
llvm-svn: 156508
|
|
|
|
|
|
|
| |
normal parse for token sequences like 'vector pixel foo'. This incidentally also
fixes a couple of wrong-parse issues.
llvm-svn: 156503
|
|
|
|
|
|
|
|
|
|
| |
so that we actually accumulate all the delayed diagnostics. Do
this so that we can restore those diagnostics to good standing
if it turns out that we were wrong to suppress, e.g. if the
tag specifier is actually an elaborated type specifier and not
a declaration.
llvm-svn: 156291
|
|
|
|
|
|
|
| |
separate pools owned by the RAII objects that keep pushing
decl state. This gives us quite a bit more flexibility.
llvm-svn: 156289
|
|
|
|
|
|
|
| |
refactorings in that revision, and some of the subsequent bugfixes, which
seem to be relevant even without delayed exception specification parsing.
llvm-svn: 156031
|
|
|
|
|
|
|
| |
the parsing of such things appears to be a conforming extension, but it breaks
libstdc++4.7's std::pair.
llvm-svn: 155975
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows
us to improve this diagnostic (telling us to insert another ")":
t.c:2:19: error: expected ';' at end of declaration
int x = 4+(5-12));
^
;
to:
t.c:2:19: error: extraneous ')' before ';'
int x = 4+(5-12));
^
...telling us to remove the ")". This is PR12595. There are more uses of ExpectAndConsumeSemi
that could be switched over, but I don't hit them on a daily basis :)
llvm-svn: 155759
|
|
|
|
| |
llvm-svn: 155723
|
|
|
|
|
|
|
| |
to a given type, when the reason is that there is a non-type decl with
the same name.
llvm-svn: 155677
|
|
|
|
|
|
| |
class; we would never actually parse it and attach it to the type.
llvm-svn: 155426
|
|
|
|
|
|
|
|
|
| |
exception specifications on member functions until after the closing
'}' for the containing class. This allows, for example, a member
function to throw an instance of its own class. Fixes PR12564 and a
fairly embarassing oversight in our C++98/03 support.
llvm-svn: 154844
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in the declaration of a non-static member function after the
(optional) cv-qualifier-seq, which in practice means in the exception
specification and late-specified return type.
The new scheme here used to manage 'this' outside of a member function
scope is more general than the Scope-based mechanism previously used
for non-static data member initializers and late-parsesd attributes,
because it can also handle the cv-qualifiers on the member
function. Note, however, that a separate pass is required for static
member functions to determine whether 'this' was used, because we
might not know that we have a static function until after declaration
matching.
Finally, this introduces name mangling for 'this' and for the implicit
'this', which is intended to match GCC's mangling. Independent
verification for the new mangling test case would be appreciated.
Fixes PR10036 and PR12450.
llvm-svn: 154799
|
|
|
|
| |
llvm-svn: 154746
|
|
|
|
|
|
|
|
|
| |
attached. Since we do not support any attributes which appertain to a statement
(yet), testing of this is necessarily quite minimal.
Patch by Alexander Kornienko!
llvm-svn: 154723
|
|
|
|
|
|
|
| |
right place to pick up parsing. In C++, this had a tendency to skip everything
declared within headers if the TU starts with garbage.
llvm-svn: 154530
|
|
|
|
| |
llvm-svn: 154476
|
|
|
|
| |
llvm-svn: 154399
|
|
|
|
|
|
|
|
|
|
| |
* Alternative tokens (such as 'compl') are treated as identifiers in
attribute names.
* An attribute-list can start with a comma.
* An ellipsis may not be used with either of our currently-supported
C++11 attributes.
llvm-svn: 154381
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* In C++11, '[[' is ill-formed unless it starts an attribute-specifier. Reject
array sizes and array indexes which begin with a lambda-expression. Recover by
parsing the lambda as a lambda.
* In Objective-C++11, either '[' could be the start of a message-send.
Fully disambiguate this case: it turns out that the grammars of message-sends,
lambdas and attributes do not actually overlap. Accept any occurrence of '[['
where either '[' starts a message send, but reject a lambda in an array index
just like in C++11 mode.
Implement a couple of changes to the attribute wording which occurred after our
attributes implementation landed:
* In a function-declaration, the attributes go after the exception specification,
not after the right paren.
* A reference type can have attributes applied.
* An 'identifier' in an attribute can also be a keyword. Support for alternative
tokens (iso646 keywords) in attributes to follow.
And some bug fixes:
* Parse attributes after declarator-ids, even if they are not simple identifiers.
* Do not accept attributes after a parenthesized declarator.
* Accept attributes after an array size in a new-type-id.
* Partially disamiguate 'delete' followed by a lambda. More work is required
here for the case where the lambda-introducer is '[]'.
llvm-svn: 154369
|
|
|
|
| |
llvm-svn: 154173
|