[Bug c++/51257] New: Template changes scope of friend functions

pubby.8 at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Nov 21 08:58:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51257

             Bug #: 51257
           Summary: Template changes scope of friend functions
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pubby.8@gmail.com


gcc version 4.7.0 20111112 (experimental) (GCC) 

Unsure about this:

struct foo {
  friend void f1() { }

  template <int x = 0>
  friend void f2() { }
};

int main(){
  f1(); // doesn't compile
  f2(); // compiles, seems like it shouldn't
}



More information about the Gcc-bugs mailing list