summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-11-20 23:40:57 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-11-20 23:40:57 +0000
commit698875aec60f5f04e95d189a017ee6789817d466 (patch)
tree9e0519101ed47b81f86a2c1192d057f1e77acf24 /clang/test
parent56215d84dc56801beeb9e7748d4ebbad71344e0c (diff)
downloadbcm5719-llvm-698875aec60f5f04e95d189a017ee6789817d466.tar.gz
bcm5719-llvm-698875aec60f5f04e95d189a017ee6789817d466.zip
Fix new check for missing semicolon after struct definition to deal with the
case where the type in the following declaration is specified as a template-id, and refactor for clarity. llvm-svn: 195280
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Parser/recovery.cpp10
-rw-r--r--clang/test/SemaObjCXX/crash.mm8
2 files changed, 14 insertions, 4 deletions
diff --git a/clang/test/Parser/recovery.cpp b/clang/test/Parser/recovery.cpp
index b5b09484ad9..60b4b5a3369 100644
--- a/clang/test/Parser/recovery.cpp
+++ b/clang/test/Parser/recovery.cpp
@@ -119,3 +119,13 @@ void MissingSemiInFunction() {
struct Inner4 {} // ok, no missing ';' here
Inner5;
}
+
+namespace NS {
+ template<typename T> struct Foo {};
+}
+struct MissingSemiThenTemplate1 {} // expected-error {{expected ';' after struct}}
+NS::Foo<int> missingSemiBeforeFunctionReturningTemplateId1();
+
+using NS::Foo;
+struct MissingSemiThenTemplate2 {} // expected-error {{expected ';' after struct}}
+Foo<int> missingSemiBeforeFunctionReturningTemplateId2();
diff --git a/clang/test/SemaObjCXX/crash.mm b/clang/test/SemaObjCXX/crash.mm
index 345f72e6093..521b923cc00 100644
--- a/clang/test/SemaObjCXX/crash.mm
+++ b/clang/test/SemaObjCXX/crash.mm
@@ -14,10 +14,10 @@ namespace std {
@implementation Test
struct EvilStruct {
-} // note the missing semicolon
+} // expected-error {{expected ';' after struct}}
- typedef std::pair<int, int> IntegerPair; // expected-error{{typedef declarator cannot be qualified}} \
-// expected-error{{typedef name must be an identifier}} \
-// expected-error{{expected ';' after top level declarator}}
+ typedef std::pair<int, int> IntegerPair;
+
+template<typename...Ts> void f(Ts); // expected-error {{unexpanded}} expected-warning {{extension}}
@end
OpenPOWER on IntegriCloud