summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/new-delete.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-04-10 01:32:12 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-04-10 01:32:12 +0000
commit7bdcc4a9da8ccbafb15872083f551366cdaf3b51 (patch)
treebb52354737aeaa0e413fe20cb96e321ba9e47aac /clang/test/SemaCXX/new-delete.cpp
parent076b3041c0706a957766f7e5e885f05b2eaf255e (diff)
downloadbcm5719-llvm-7bdcc4a9da8ccbafb15872083f551366cdaf3b51.tar.gz
bcm5719-llvm-7bdcc4a9da8ccbafb15872083f551366cdaf3b51.zip
Disambiguation of '[[':
* 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
Diffstat (limited to 'clang/test/SemaCXX/new-delete.cpp')
-rw-r--r--clang/test/SemaCXX/new-delete.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/new-delete.cpp b/clang/test/SemaCXX/new-delete.cpp
index 88d85ca792e..e77e3d652f4 100644
--- a/clang/test/SemaCXX/new-delete.cpp
+++ b/clang/test/SemaCXX/new-delete.cpp
@@ -102,8 +102,7 @@ void good_deletes()
void bad_deletes()
{
delete 0; // expected-error {{cannot delete expression of type 'int'}}
- delete [0] (int*)0; // expected-error {{expected ']'}} \
- // expected-note {{to match this '['}}
+ delete [0] (int*)0; // expected-error {{expected expression}}
delete (void*)0; // expected-warning {{cannot delete expression with pointer-to-'void' type 'void *'}}
delete (T*)0; // expected-warning {{deleting pointer to incomplete type}}
::S::delete (int*)0; // expected-error {{expected unqualified-id}}
OpenPOWER on IntegriCloud