From 5a477c5e372bde1f96c1146b5a68f02c7e93f40b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 15 Jul 2014 00:11:48 +0000 Subject: PR19751: (T())++ is not a cast-expression. llvm-svn: 213022 --- clang/test/Parser/cxx-casting.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/test/Parser/cxx-casting.cpp') diff --git a/clang/test/Parser/cxx-casting.cpp b/clang/test/Parser/cxx-casting.cpp index 55309a13560..d2c97b88b80 100644 --- a/clang/test/Parser/cxx-casting.cpp +++ b/clang/test/Parser/cxx-casting.cpp @@ -101,5 +101,11 @@ void PR19748() { (true ? (B(*)())f : p)(); } +void PR19751(int n) { + struct T { void operator++(int); }; + (T())++; // ok, not an ill-formed cast to function type + (T())++n; // expected-error {{C-style cast from 'int' to 'T ()' is not allowed}} +} + // PR13619. Must be at end of file. int n = reinterpret_cast // expected-error {{expected '<'}} expected-error {{expected ';'}} -- cgit v1.2.3