Skip to content
Snippets Groups Projects
Commit c1bb6c2e authored by Vassil Vassilev's avatar Vassil Vassilev
Browse files

Test canonical specialization removal.

parent ce1c6fc5
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment