public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/37971]  New: [4.3/4.4 Regression] Rejects default  argument that is a template
@ 2008-10-31  0:07 pinskia at gcc dot gnu dot org
  2008-10-31  0:08 ` [Bug c++/37971] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-10-31  0:07 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1089 bytes --]

Take:
struct foo
{
  private:
 template<typename U>
 static bool func(const U& x) {}
 static bool func1(const int& x) {}
public:
 unsigned int Find(const int& x, bool (*pFunc) (const int&) = func) const {}
 unsigned int Find1(const int& x, bool (*pFunc) (const int&) = func1) const {}
};

foo b;
void f(void)
{
  b.Find1(1);
  b.Find(1);
}

--- CUT ---
Only the call to Find is rejected with the following error message:
t.cc: In function ‘void f()’:
t.cc:5: error: ‘static bool foo::func(const U&) [with U = int]’ is private
t.cc:16: error: within this context

This is wrong as func is not private in the default argument.


-- 
           Summary: [4.3/4.4 Regression] Rejects default  argument that is a
                    template
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 15+ messages in thread
[parent not found: <bug-37971-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-06-27 11:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-31  0:07 [Bug c++/37971] New: [4.3/4.4 Regression] Rejects default argument that is a template pinskia at gcc dot gnu dot org
2008-10-31  0:08 ` [Bug c++/37971] " pinskia at gcc dot gnu dot org
2008-10-31  0:15 ` [Bug c++/37971] [4.3/4.4 Regression] Rejects default argument that is a template via access failure pinskia at gcc dot gnu dot org
2008-10-31  0:37 ` [Bug c++/37971] [4.2/4.3/4.4 " pinskia at gcc dot gnu dot org
2008-10-31  0:40 ` pinskia at gcc dot gnu dot org
2008-10-31 11:39 ` rguenth at gcc dot gnu dot org
2008-10-31 17:36 ` mmitchel at gcc dot gnu dot org
2008-11-05 18:29 ` mmitchel at gcc dot gnu dot org
2008-12-10  1:26 ` mmitchel at gcc dot gnu dot org
2008-12-11 11:45 ` [Bug c++/37971] [4.2/4.3 " rguenth at gcc dot gnu dot org
2008-12-11 17:28 ` mmitchel at gcc dot gnu dot org
2009-03-31 21:01 ` [Bug c++/37971] [4.3 " jsm28 at gcc dot gnu dot org
2009-08-04 12:43 ` rguenth at gcc dot gnu dot org
2010-05-22 18:27 ` rguenth at gcc dot gnu dot org
     [not found] <bug-37971-4@http.gcc.gnu.org/bugzilla/>
2011-06-27 11:57 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).