diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-07-15 17:07:12 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-07-15 17:07:12 +0000 |
commit | f1752835b9d5f0da31f34b18c9f1eb8dcb799ba8 (patch) | |
tree | 5e946d69177464379cb1a38ac18206180d763639 /test/SemaTemplate | |
parent | 1928da94b55683957759d5c5ff4593a118773394 (diff) | |
download | FreeBSD-src-f1752835b9d5f0da31f34b18c9f1eb8dcb799ba8.zip FreeBSD-src-f1752835b9d5f0da31f34b18c9f1eb8dcb799ba8.tar.gz |
Update clang to r108428.
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r-- | test/SemaTemplate/deduction-crash.cpp | 59 | ||||
-rw-r--r-- | test/SemaTemplate/deduction.cpp | 2 |
2 files changed, 60 insertions, 1 deletions
diff --git a/test/SemaTemplate/deduction-crash.cpp b/test/SemaTemplate/deduction-crash.cpp new file mode 100644 index 0000000..1860c75 --- /dev/null +++ b/test/SemaTemplate/deduction-crash.cpp @@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -fsyntax-only %s 2>&1| FileCheck %s + +// PR7511 + +// Note that the error count below doesn't matter. We just want to +// make sure that the parser doesn't crash. +// CHECK: 16 errors +template<a> +struct int_; + +template<a> +template<int,typename T1,typename> +struct ac +{ + typedef T1 ae +}; + +template<class>struct aaa +{ + typedef ac<1,int,int>::ae ae +}; + +template<class> +struct state_machine +{ + typedef aaa<int>::ae aaa; + int start() + { + ant(0); + } + + template<class> + struct region_processing_helper + { + template<class,int=0> + struct In; + + template<int my> + struct In<a::int_<aaa::a>,my>; + + template<class Event> + int process(Event) + { + In<a::int_<0> > a; + } + } + template<class Event> + int ant(Event) + { + region_processing_helper<int>* helper; + helper->process(0) + } +}; + +int a() +{ + state_machine<int> p; + p.ant(0); +} diff --git a/test/SemaTemplate/deduction.cpp b/test/SemaTemplate/deduction.cpp index 25ffb67..e8ff8d3 100644 --- a/test/SemaTemplate/deduction.cpp +++ b/test/SemaTemplate/deduction.cpp @@ -101,7 +101,7 @@ namespace PR6257 { // PR7463 namespace PR7463 { - const int f (); // expected-warning{{type qualifier on return type has no effect}} + const int f (); template <typename T_> void g (T_&); // expected-note{{T_ = int}} void h (void) { g(f()); } // expected-error{{no matching function for call}} } |