summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/ms-delayed-default-template-args.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/ms-delayed-default-template-args.cpp')
-rw-r--r--test/SemaTemplate/ms-delayed-default-template-args.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaTemplate/ms-delayed-default-template-args.cpp b/test/SemaTemplate/ms-delayed-default-template-args.cpp
index ca9ddb0d9d158..0c05469424758 100644
--- a/test/SemaTemplate/ms-delayed-default-template-args.cpp
+++ b/test/SemaTemplate/ms-delayed-default-template-args.cpp
@@ -55,6 +55,15 @@ struct Foo {
typedef int Weber;
}
+// MSVC accepts this, but Clang doesn't.
+namespace test_scope_spec {
+template <typename T = ns::Bar> // expected-error {{use of undeclared identifier 'ns'}}
+struct Foo {
+ static_assert(sizeof(T) == 4, "Bar should have gotten int");
+};
+namespace ns { typedef int Bar; }
+}
+
#ifdef __clang__
// These are negative test cases that MSVC doesn't compile either. Try to use
// unique undeclared identifiers so typo correction doesn't find types declared