summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/typo-correction-crash.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-06-30 20:24:30 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-06-30 20:24:30 +0000
commit9276143e24b079a90482999db58611a459501473 (patch)
tree973ad9a2e87e75108d9d15aa88bf6271776c109b /test/SemaCXX/typo-correction-crash.cpp
parent56a9798df3b2217e296a63f3798678eb681d66c7 (diff)
Fix typo-correction crash if a typo occurs within the operand of a
function-style cast to a non-dependent type which is then used in an invalid way. We'd lose the "type dependent" bit here, and downstream Sema processing would then discard the expression if it was used in a context where its type rendered it invalid. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/typo-correction-crash.cpp')
-rw-r--r--test/SemaCXX/typo-correction-crash.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/SemaCXX/typo-correction-crash.cpp b/test/SemaCXX/typo-correction-crash.cpp
index 6349937ccd..0b8383dbaf 100644
--- a/test/SemaCXX/typo-correction-crash.cpp
+++ b/test/SemaCXX/typo-correction-crash.cpp
@@ -17,3 +17,5 @@ typedef int type;
}
struct FooRecord { };
FooRecord::NestedNamespace::type x; // expected-error {{no member named 'NestedNamespace' in 'FooRecord'; did you mean 'BarNamespace::NestedNamespace'?}}
+
+void cast_expr(int g) { +int(n)(g); } // expected-error {{undeclared identifier 'n'}}