diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-04-22 23:20:44 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-04-22 23:20:44 +0000 |
commit | d4a0caf78e7c18e7aca65fbfd799a6c024ff51fb (patch) | |
tree | e0c749c65c3d296353cb862f69c8934d5576e9d8 /test/Parser/DelayedTemplateParsing.cpp | |
parent | b464a5b18916b467ed884d07f9e34295d39cec0a (diff) |
Correctly emit a diagnostic for multiple templated function definitions in -flate-template-parsing mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/DelayedTemplateParsing.cpp')
-rw-r--r-- | test/Parser/DelayedTemplateParsing.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test/Parser/DelayedTemplateParsing.cpp b/test/Parser/DelayedTemplateParsing.cpp index 355250e4b0..50cf7412cc 100644 --- a/test/Parser/DelayedTemplateParsing.cpp +++ b/test/Parser/DelayedTemplateParsing.cpp @@ -2,14 +2,23 @@ template <class T>
class A {
-
void foo() {
undeclared();
}
-
- void foo2();
+ 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();
@@ -29,3 +38,5 @@ void undeclared() }
+template <class T> void foo5() {} //expected-note {{previous definition is here}}
+template <class T> void foo5() {} // expected-error {{redefinition of 'foo5'}}
|