aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx-decl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-10 02:08:07 +0000
committerChris Lattner <sabre@nondot.org>2009-12-10 02:08:07 +0000
commit932dff777d58a23e3a26967a61bb52697c542fd4 (patch)
tree15c343d9ba56c3a30f25c816c4bfa1cffbfabc09 /test/Parser/cxx-decl.cpp
parenta69d0ed3ab66e96393586664a103e9482ec59e6f (diff)
If we enter parens, colons can become un-sacred, allowing us to emit
a better diagnostic in the second example. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx-decl.cpp')
-rw-r--r--test/Parser/cxx-decl.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/Parser/cxx-decl.cpp b/test/Parser/cxx-decl.cpp
index 38467117b3..6f3fd391b9 100644
--- a/test/Parser/cxx-decl.cpp
+++ b/test/Parser/cxx-decl.cpp
@@ -9,7 +9,8 @@ struct Type {
// PR4451 - We should recover well from the typo of '::' as ':' in a2.
namespace y {
- struct a { };
+ struct a { };
+ typedef int b;
}
y::a a1;
@@ -45,4 +46,9 @@ struct a {
void test(struct Type *P) {
int Type;
Type = 1 ? P->Type : Type;
+
+ Type = (y:b) 4; // expected-error {{unexpected ':' in nested name specifier}}
+ Type = 1 ? (
+ (y:b) // expected-error {{unexpected ':' in nested name specifier}}
+ 4) : 5;
} \ No newline at end of file