1 // { dg-do assemble } 2 // 3 // Copyright (C) 2001, 2003 Free Software Foundation, Inc. 4 // Contributed by Nathan Sidwell 29 Apr 2001 <nathan@codesourcery.com> 5 6 // Bug 2258. We failed to implement using directives inside template 7 // functions. This makes us regress now that ::std is real. 8 9 namespace thing 10 { 11 template <typename T> T end2 (T); 12 } 13 namespace whatever 14 { 15 } 16 17 template <typename T> void fn (T, T (*)(T)); 18 19 namespace whatever 20 { 21 template <typename T> T end3 (T); 22 } 23 mycout(const T & data)24template <class T> void mycout(const T& data) 25 { 26 using namespace thing; 27 using namespace whatever; 28 29 fn (data, end2); 30 fn (data, end3); 31 } 32 main()33int main() 34 { 35 double data = 5.0; 36 mycout(data); 37 } 38