diff options
author | dim <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
commit | 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (patch) | |
tree | 64a10f4c4154739d4a8191d7e1b52ce497f4ebd6 /test/Parser/DelayedTemplateParsing.cpp | |
parent | a0fb00f9837bd0d2e5948f16f6a6b82a7a628f51 (diff) | |
download | FreeBSD-src-110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab.zip FreeBSD-src-110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab.tar.gz |
Vendor import of clang trunk r130700:
http://llvm.org/svn/llvm-project/cfe/trunk@130700
Diffstat (limited to 'test/Parser/DelayedTemplateParsing.cpp')
-rw-r--r-- | test/Parser/DelayedTemplateParsing.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/Parser/DelayedTemplateParsing.cpp b/test/Parser/DelayedTemplateParsing.cpp new file mode 100644 index 0000000..b447fff --- /dev/null +++ b/test/Parser/DelayedTemplateParsing.cpp @@ -0,0 +1,42 @@ +// RUN: %clang_cc1 -fdelayed-template-parsing -fsyntax-only -verify %s + +template <class T> +class A { + void foo() { + undeclared(); + } + void foo2(); +}; + +template <class T> +class B { + void foo4() { } // expected-note {{previous definition is here}} expected-note {{previous definition is here}} + void foo4() { } // expected-error {{class member cannot be redeclared}} expected-error {{redefinition of 'foo4'}} expected-note {{previous definition is here}} +}; + + +template <class T> +void B<T>::foo4() {// expected-error {{redefinition of 'foo4'}} +} + +template <class T> +void A<T>::foo2() { + undeclared(); +} + + +template <class T> +void foo3() { + undeclared(); +} + +template void A<int>::foo2(); + + +void undeclared() +{ + +} + +template <class T> void foo5() {} //expected-note {{previous definition is here}} +template <class T> void foo5() {} // expected-error {{redefinition of 'foo5'}} |