public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53628] New: [C++11][DR 712] Compiler requires definition of static member constants when not odr-used
@ 2012-06-10 21:35 daniel.kruegler at googlemail dot com
  2012-06-10 21:39 ` [Bug c++/53628] " daniel.kruegler at googlemail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-06-10 21:35 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53628
           Summary: [C++11][DR 712] Compiler requires definition of static
                    member constants when not odr-used
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com


The following example leads to a linker error when compiled in C++11 mode using
gcc 4.8.0 20120603 (experimental):

//---
struct S
{
  static const int a = 1;
  static const int b = 2;
};

int main(int argc, char** argv)
{
  return argc > 1 ? S::a : S::b;
}
//---

"8|undefined reference to `S::a'|
8|undefined reference to `S::b'"

This example is now valid with the acceptance of

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#712

and should no longer require a definition of either S::a or S::b.


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

* [Bug c++/53628] [C++11][DR 712] Compiler requires definition of static member constants when not odr-used
  2012-06-10 21:35 [Bug c++/53628] New: [C++11][DR 712] Compiler requires definition of static member constants when not odr-used daniel.kruegler at googlemail dot com
@ 2012-06-10 21:39 ` daniel.kruegler at googlemail dot com
  2012-06-10 21:43 ` daniel.kruegler at googlemail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-06-10 21:39 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |link-failure

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-06-10 21:38:56 UTC ---
I would like to add that exactly the same example is still the main example of
the otherwise valid explanations in

http://gcc.gnu.org/wiki/VerboseDiagnostics#missing_static_const_definition

This particular example should be modified as well (or marked to be valid in
C++03 only)


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

* [Bug c++/53628] [C++11][DR 712] Compiler requires definition of static member constants when not odr-used
  2012-06-10 21:35 [Bug c++/53628] New: [C++11][DR 712] Compiler requires definition of static member constants when not odr-used daniel.kruegler at googlemail dot com
  2012-06-10 21:39 ` [Bug c++/53628] " daniel.kruegler at googlemail dot com
@ 2012-06-10 21:43 ` daniel.kruegler at googlemail dot com
  2012-06-10 21:49 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-06-10 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-06-10 21:43:24 UTC ---
(In reply to comment #1)
> I would like to add that exactly the same example is still the main example of
> the otherwise valid explanations in
> 
> http://gcc.gnu.org/wiki/VerboseDiagnostics#missing_static_const_definition
> 
> This particular example should be modified as well (or marked to be valid in
> C++03 only)

Jonathan was quicker than I could write this...


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

* [Bug c++/53628] [C++11][DR 712] Compiler requires definition of static member constants when not odr-used
  2012-06-10 21:35 [Bug c++/53628] New: [C++11][DR 712] Compiler requires definition of static member constants when not odr-used daniel.kruegler at googlemail dot com
  2012-06-10 21:39 ` [Bug c++/53628] " daniel.kruegler at googlemail dot com
  2012-06-10 21:43 ` daniel.kruegler at googlemail dot com
@ 2012-06-10 21:49 ` redi at gcc dot gnu.org
  2013-06-12 10:42 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2012-06-10 21:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-06-10 21:48:51 UTC ---
(In reply to comment #1)
> I would like to add that exactly the same example is still the main example of
> the otherwise valid explanations in
> 
> http://gcc.gnu.org/wiki/VerboseDiagnostics#missing_static_const_definition
> 
> This particular example should be modified as well (or marked to be valid in
> C++03 only)

And C++11, and every released version of G++.

I've added a note to the wiki regarding DR 712 but the point of that page is to
explain common errors people get from G++ and that example is taken from
numerous bug reports. Even when DR 712 is implemented it will remain relevant
for past releases so feel free to update the wiki yourself, but try to keep it
useful for people using old releases who are surprised the example won't link,
e.g. PR 53614 reported this week against GCC 4.4


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

* [Bug c++/53628] [C++11][DR 712] Compiler requires definition of static member constants when not odr-used
  2012-06-10 21:35 [Bug c++/53628] New: [C++11][DR 712] Compiler requires definition of static member constants when not odr-used daniel.kruegler at googlemail dot com
                   ` (2 preceding siblings ...)
  2012-06-10 21:49 ` redi at gcc dot gnu.org
@ 2013-06-12 10:42 ` redi at gcc dot gnu.org
  2015-03-24 13:39 ` paolo.carlini at oracle dot com
  2015-03-24 14:22 ` daniel.kruegler at googlemail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2013-06-12 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-06-12
     Ever confirmed|0                           |1


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

* [Bug c++/53628] [C++11][DR 712] Compiler requires definition of static member constants when not odr-used
  2012-06-10 21:35 [Bug c++/53628] New: [C++11][DR 712] Compiler requires definition of static member constants when not odr-used daniel.kruegler at googlemail dot com
                   ` (3 preceding siblings ...)
  2013-06-12 10:42 ` redi at gcc dot gnu.org
@ 2015-03-24 13:39 ` paolo.carlini at oracle dot com
  2015-03-24 14:22 ` daniel.kruegler at googlemail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-24 13:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53628

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.8.0, 5.0
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
This works in the released 4.8.0.


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

* [Bug c++/53628] [C++11][DR 712] Compiler requires definition of static member constants when not odr-used
  2012-06-10 21:35 [Bug c++/53628] New: [C++11][DR 712] Compiler requires definition of static member constants when not odr-used daniel.kruegler at googlemail dot com
                   ` (4 preceding siblings ...)
  2015-03-24 13:39 ` paolo.carlini at oracle dot com
@ 2015-03-24 14:22 ` daniel.kruegler at googlemail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2015-03-24 14:22 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 2830 bytes --]

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53628

--- Comment #5 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Paolo Carlini from comment #4)
> This works in the released 4.8.0.

Thanks, I agree. Confirmed to work for gcc 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2,
and HEAD 5.0.0 20150323 (experimental).
>From gcc-bugs-return-481436-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Mar 24 14:09:44 2015
Return-Path: <gcc-bugs-return-481436-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 125871 invoked by alias); 24 Mar 2015 14:09:44 -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 125773 invoked by uid 48); 24 Mar 2015 14:09:36 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/65519] [5 regression] unable to coalesce ssa_names 2 and 87 which are marked as MUST COALESCE
Date: Tue, 24 Mar 2015 14:30:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.isobsolete assigned_to attachments.created
Message-ID: <bug-65519-4-YBTZwp8bmE@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65519-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65519-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: 2015-03/txt/msg02580.txt.bz2
Content-length: 603

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide519

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35121|0                           |1
        is obsolete|                            |
           Assignee|ebotcazou at gcc dot gnu.org       |rguenth at gcc dot gnu.org

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 35126
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id5126&actioníit
updated patch


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

end of thread, other threads:[~2015-03-24 13:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-10 21:35 [Bug c++/53628] New: [C++11][DR 712] Compiler requires definition of static member constants when not odr-used daniel.kruegler at googlemail dot com
2012-06-10 21:39 ` [Bug c++/53628] " daniel.kruegler at googlemail dot com
2012-06-10 21:43 ` daniel.kruegler at googlemail dot com
2012-06-10 21:49 ` redi at gcc dot gnu.org
2013-06-12 10:42 ` redi at gcc dot gnu.org
2015-03-24 13:39 ` paolo.carlini at oracle dot com
2015-03-24 14:22 ` daniel.kruegler at googlemail dot com

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).