public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58885] Template static variable linking issue!
       [not found] <bug-58885-4@http.gcc.gnu.org/bugzilla/>
@ 2013-10-26 15:37 ` daniel.kruegler at googlemail dot com
  2013-10-26 19:42 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-10-26 15:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The linker is correct to signal an error here, because the explicit
specialization

template<> 
CGEnum<int, Test_Enum>::instances_list 
CGEnum<int, Test_Enum>::msInstances;

is considered a non-defining declaration as of 14.7.3 p13:

"An explicit specialization of a static data member of a template or an
explicit specialization of a static data member template is a definition if the
declaration includes an initializer; otherwise, it is a declaration."

The necessary fix is to provide the initializer, because the corresponding
entity is odr-used in the program:

template<> 
CGEnum<int, Test_Enum>::instances_list 
CGEnum<int, Test_Enum>::msInstances{};
>From gcc-bugs-return-432792-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 15:51:17 2013
Return-Path: <gcc-bugs-return-432792-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 9402 invoked by alias); 26 Oct 2013 15:51:16 -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 9284 invoked by uid 48); 26 Oct 2013 15:51:10 -0000
From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
Date: Sat, 26 Oct 2013 15:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ebotcazou at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-58679-4-Ny9PB8pfop@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58679-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58679-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-10/txt/msg01936.txt.bz2
Content-length: 1170

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu.org

--- Comment #8 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Or should we use a different approach, and use DF to re-create REG_DEAD
> notes?

Yes, if you need REG_DEAD/REG_UNUSED notes, just tell DF to compute them:

eric@polaris:~/gnat/gnat-head/src/gcc> grep df_note_add_problem *.c
auto-inc-dec.c:  df_note_add_problem ();
cfgrtl.c:      df_note_add_problem ();
combine.c:  df_note_add_problem ();
combine-stack-adj.c:  df_note_add_problem ();
cse.c:  df_note_add_problem ();
df-problems.c:df_note_add_problem (void)
dse.c:  df_note_add_problem ();
fwprop.c:  df_note_add_problem ();
haifa-sched.c:  df_note_add_problem ();
ira.c:  df_note_add_problem ();
loop-iv.c:  df_note_add_problem ();
recog.c:  df_note_add_problem ();
regmove.c:  df_note_add_problem ();
regrename.c:  df_note_add_problem ();
reg-stack.c:  df_note_add_problem ();


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

* [Bug c++/58885] Template static variable linking issue!
       [not found] <bug-58885-4@http.gcc.gnu.org/bugzilla/>
  2013-10-26 15:37 ` [Bug c++/58885] Template static variable linking issue! daniel.kruegler at googlemail dot com
@ 2013-10-26 19:42 ` paolo.carlini at oracle dot com
  2013-10-26 20:19 ` vehbi.esref.bayraktar at gmail dot com
  2013-10-26 21:21 ` daniel.kruegler at googlemail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-10-26 19:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Thanks Daniel.


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

* [Bug c++/58885] Template static variable linking issue!
       [not found] <bug-58885-4@http.gcc.gnu.org/bugzilla/>
  2013-10-26 15:37 ` [Bug c++/58885] Template static variable linking issue! daniel.kruegler at googlemail dot com
  2013-10-26 19:42 ` paolo.carlini at oracle dot com
@ 2013-10-26 20:19 ` vehbi.esref.bayraktar at gmail dot com
  2013-10-26 21:21 ` daniel.kruegler at googlemail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: vehbi.esref.bayraktar at gmail dot com @ 2013-10-26 20:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Vehbi Esref Bayraktar <vehbi.esref.bayraktar at gmail dot com> ---
So why doesn't it compile as is
CGEnum<int, Test_Enum>::instances_list CGEnum<int, Test_Enum>::msInstances;

and asks for a specialization notation (template<>)?

Thanks


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

* [Bug c++/58885] Template static variable linking issue!
       [not found] <bug-58885-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2013-10-26 20:19 ` vehbi.esref.bayraktar at gmail dot com
@ 2013-10-26 21:21 ` daniel.kruegler at googlemail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-10-26 21:21 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: 2895 bytes --]

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

--- Comment #5 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Vehbi Esref Bayraktar from comment #4)
> So why doesn't it compile as is
> CGEnum<int, Test_Enum>::instances_list CGEnum<int, Test_Enum>::msInstances;
> and asks for a specialization notation (template<>)?

Well, because that would be invalid C++ otherwise. The most reasonable
interpretation is to assume that this would be an attempt to specialize that
member and this would require the template<> prefix. What else should it be?
>From gcc-bugs-return-432810-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 21:50:58 2013
Return-Path: <gcc-bugs-return-432810-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4910 invoked by alias); 26 Oct 2013 21:50:58 -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 4862 invoked by uid 48); 26 Oct 2013 21:50:55 -0000
From: "igor.shevlyakov at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/39693] Warning about uninitialized local variable use
Date: Sat, 26 Oct 2013 21:50:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.3.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: igor.shevlyakov at gmail dot com
X-Bugzilla-Status: RESOLVED
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: cc attachments.created
Message-ID: <bug-39693-4-RB4bxnLUH8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-39693-4@http.gcc.gnu.org/bugzilla/>
References: <bug-39693-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-10/txt/msg01954.txt.bz2
Content-length: 508

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

Igor Shevlyakov <igor.shevlyakov at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |igor.shevlyakov at gmail dot com

--- Comment #5 from Igor Shevlyakov <igor.shevlyakov at gmail dot com> ---
Created attachment 31093
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id1093&actioníit
test file


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

end of thread, other threads:[~2013-10-26 21:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-58885-4@http.gcc.gnu.org/bugzilla/>
2013-10-26 15:37 ` [Bug c++/58885] Template static variable linking issue! daniel.kruegler at googlemail dot com
2013-10-26 19:42 ` paolo.carlini at oracle dot com
2013-10-26 20:19 ` vehbi.esref.bayraktar at gmail dot com
2013-10-26 21:21 ` 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).