Test canonical specialization removal.
This commit is contained in:
parent
a515de40b8
commit
3751cef9a9
@ -4,6 +4,7 @@
|
||||
.rawInput 1
|
||||
extern int __my_i;
|
||||
template<typename T> T TemplatedF(T t);
|
||||
template<> double TemplatedF(double); // forward declare TemplatedF
|
||||
int OverloadedF(int i);
|
||||
float OverloadedF(float f){ return f + 100.111f;}
|
||||
double OverloadedF(double d){ return d + 10.11f; };
|
||||
@ -15,6 +16,8 @@ namespace test { int y = 0; }
|
||||
.compareState "testSubsequentDecls"
|
||||
// CHECK-NOT: Differences
|
||||
|
||||
TemplatedF((int)2) // expected-diagnostics{{C++ requires a type specifier for all declarations}} expected-diagnostics{{expected ';' after top level declarator}}
|
||||
|
||||
.rawInput 1
|
||||
template<> int TemplatedF(int i) { return i + 100; }
|
||||
int OverloadedF(int i) { return i + 100;}
|
||||
@ -27,4 +30,6 @@ OverloadedF(__my_i)
|
||||
TemplatedF(__my_i)
|
||||
// CHECK: (int) 110
|
||||
|
||||
TemplatedF((double)3.14)
|
||||
// CHECK: use of undefined symbol '_Z10TemplatedFIdET_S0_'
|
||||
.q
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
// Template specializations
|
||||
template<> int TemplatedF(int t){return t + 10;}
|
||||
template<> double TemplatedF(double t){return t + 3.14;}
|
||||
|
||||
// Aliases
|
||||
typedef struct A AStruct;
|
||||
|
Loading…
x
Reference in New Issue
Block a user