2011-09-23 06:14:56 +08:00
// RUN: %clang_cc1 -fms-extensions -fdelayed-template-parsing -fsyntax-only -verify %s
2011-04-25 14:34:35 +08:00
template < class T >
class A {
void foo ( ) {
undeclared ( ) ;
}
2011-09-23 06:14:56 +08:00
void foo2 ( ) ;
2011-04-25 14:34:35 +08:00
} ;
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}}
2011-11-19 07:47:17 +08:00
friend void foo3 ( ) {
undeclared ( ) ;
}
2011-04-25 14:34:35 +08:00
} ;
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'}}
2011-09-23 06:14:56 +08:00
namespace Inner_Outer_same_template_param_name {
template < class T >
class Outmost {
public :
template < class T >
class Inner {
public :
void f ( ) {
T * var ;
}
} ;
} ;
}