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

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