diff options
author | YamaArashi <shadow962@live.com> | 2016-01-06 01:47:28 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-01-06 01:47:28 -0800 |
commit | be8b04496302184c6e8f04d6179f9c3afc50aeb6 (patch) | |
tree | 726e2468c0c07add773c0dbd86ab6386844259ae /gcc/testsuite/g++.old-deja/g++.ns/overload1.C |
initial commit
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.ns/overload1.C')
-rwxr-xr-x | gcc/testsuite/g++.old-deja/g++.ns/overload1.C | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/overload1.C b/gcc/testsuite/g++.old-deja/g++.ns/overload1.C new file mode 100755 index 0000000..55d66a1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.ns/overload1.C @@ -0,0 +1,33 @@ +// Unqualified lookup should find all functions. +// Duplicates are ignored as long as they lose during overload resolution. +namespace A{ + int f(){ + return 1; + } + int f(double); +} +namespace B{ + int f(int){ + return 2; + } + int f(double); +} + +int f(int,int) +{ + return 3; +} + +using namespace A; +using namespace B; + +int main() +{ + if(f() != 1) + return 1; + if(f(1) != 2) + return 1; + if(f(0,0) != 3) + return 1; + return 0; +} |