aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/explicit-instantiation.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-13 00:10:04 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-13 00:10:04 +0000
commit669eed8d676458c701f45f7fd686f01de2dee53b (patch)
treef1207aca112b5472c4f646fd2c9c7ae99403ab68 /test/SemaTemplate/explicit-instantiation.cpp
parentdd41ed59cf7aefabd40bf766d8fcc7ebd759c8e5 (diff)
Provide a special diagnostic for attempts to explicitly specialize
class templates within class scope (which is ill-formed), and recover by dropping the explicit specialization entirely. Fixes the infinite loop in PR7622. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108217 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/explicit-instantiation.cpp')
-rw-r--r--test/SemaTemplate/explicit-instantiation.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/explicit-instantiation.cpp b/test/SemaTemplate/explicit-instantiation.cpp
index de51f0992b..3a1446e8dd 100644
--- a/test/SemaTemplate/explicit-instantiation.cpp
+++ b/test/SemaTemplate/explicit-instantiation.cpp
@@ -83,3 +83,16 @@ namespace explicit_instantiation_after_implicit_instantiation {
void test1() { (void)&X0<1>::x; }
template struct X0<1>;
}
+
+namespace PR7622 { // expected-note{{to match this}}
+ template<typename,typename=int>
+ struct basic_streambuf;
+
+ // FIXME: Very poor recovery here.
+ template<typename,typename>
+ struct basic_streambuf{friend bob<>()}; // expected-error{{unknown type name 'bob'}} \
+ // expected-error{{ expected member name or ';' after declaration specifiers}}
+ template struct basic_streambuf<int>; // expected-error{{explicit instantiation of 'basic_streambuf' in class scope}}
+} // expected-error{{expected ';' after struct}}
+
+//expected-error{{expected '}'}}