summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx-casting.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-07-15 00:11:48 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-07-15 00:11:48 +0000
commit5a477c5e372bde1f96c1146b5a68f02c7e93f40b (patch)
treed82f60b1b07b76462b5f543314d8178ec9dc2950 /clang/test/Parser/cxx-casting.cpp
parentee54aaef0c87a55f75320dc9def39eaa2c267f64 (diff)
downloadbcm5719-llvm-5a477c5e372bde1f96c1146b5a68f02c7e93f40b.tar.gz
bcm5719-llvm-5a477c5e372bde1f96c1146b5a68f02c7e93f40b.zip
PR19751: (T())++ is not a cast-expression.
llvm-svn: 213022
Diffstat (limited to 'clang/test/Parser/cxx-casting.cpp')
-rw-r--r--clang/test/Parser/cxx-casting.cpp6
1 files changed, 6 insertions, 0 deletions
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 ';'}}
OpenPOWER on IntegriCloud