public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57746] New: rejected valid specialization of member function of class template (I think)
@ 2013-06-27 23:43 luto at mit dot edu
  2013-06-29 13:11 ` [Bug c++/57746] " daniel.kruegler at googlemail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: luto at mit dot edu @ 2013-06-27 23:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57746
           Summary: rejected valid specialization of member function of
                    class template (I think)
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luto at mit dot edu

Note: I could easily be wrong here...

template<typename T>
struct X
{
  static int val;
  static void func();
};

extern template struct X<int>;

template<> int X<int>::val = 5;  // OK
template<> void X<int>::func() {}  // Error

g++ 4.7.2 and some pre-4.8 build say "error: specialization of ‘static void
X<T>::func() [with T = int]’ after instantiation".  Oddly, both accept the
specialization of val.  clang++ rejects both.

The relevant part of the standard is probably [temp.explicit.4], which says:

A declaration of a function template, a member function or static data member
of a class template, or a member function template of a class or class template
shall precede an explicit instantiation of that entity. A definition of a class
template, a member class of a class template, or a member class template of a
class or class template shall precede an explicit instantiation of that entity
unless the explicit instantiation is preceded by an explicit specialization of
the entity with the same template arguments. If the declaration of the explicit
instantiation names an implicitly-declared special member function (Clause 12),
the program is ill-formed.

The two specializations are definitions, not declarations, as far as I know. 
Therefore, [temp.explicit.4] shouldn't apply.
>From gcc-bugs-return-425357-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jun 28 00:30:08 2013
Return-Path: <gcc-bugs-return-425357-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 6040 invoked by alias); 28 Jun 2013 00:30:08 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 5966 invoked by uid 48); 28 Jun 2013 00:30:04 -0000
From: "dscott at hmc dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57747] New: The progress indicator always shows 38%
Date: Fri, 28 Jun 2013 00:30:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.7.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dscott at hmc dot edu
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-57747-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-06/txt/msg01736.txt.bz2
Content-length: 1030

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW747

            Bug ID: 57747
           Summary: The progress indicator always shows 38%
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dscott at hmc dot edu

We had a large project which repeatedly hit a compiler or linker error at 38%.
The build is managed by CMake, and worked correctly before we introduced the
bugs that caused the aforementioned compiler/linker errors.  We finally fixed
the bugs in our code, then re-ran CMake (clearing its cache), ran make clean,
and then ran make.  We were very confused to see the progress indicator always
read 38%.  We terminated compilation and did another make clean.  We then
allowed make to run all the way through --- and the build ran successfully from
start to finish.  However, at every single step along the way, the progress was
reported as 38%.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-08-02  3:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-27 23:43 [Bug c++/57746] New: rejected valid specialization of member function of class template (I think) luto at mit dot edu
2013-06-29 13:11 ` [Bug c++/57746] " daniel.kruegler at googlemail dot com
2013-06-30 12:38 ` redi at gcc dot gnu.org
2013-06-30 12:50 ` daniel.kruegler at googlemail dot com
2013-07-02  0:04 ` luto at mit dot edu
2013-07-02 18:30 ` luto at mit dot edu
2013-07-02 21:03 ` daniel.kruegler at googlemail dot com
2021-08-02  3:16 ` [Bug c++/57746] Invalid specializations of member objects are accepted, unlike member functions pinskia 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).