public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10648: template instantiation doesn't respect evaluation order of &&
@ 2003-05-06 22:56 notbob
  0 siblings, 0 replies; 2+ messages in thread
From: notbob @ 2003-05-06 22:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10648
>Category:       c++
>Synopsis:       template instantiation doesn't respect evaluation order of &&
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 06 22:56:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Robert Allan Schwartz
>Release:        gcc version 3.2 20020927 (prerelease)
>Organization:
>Environment:
in bash via cygwin on windows 98 se
>Description:
I apologize in advance if I'm not reporting this "bug"
absolutely correctly. I haven't done this before. I
appreciate your patience. Thank you.

I believe my template should evaluate is_class<T>::value first, and if it returns false, should NOT evaluate
sizeof(is_empty_helper_class_1<T>) ==
sizeof(is_empty_helper_class_2<T>), but it seems to anyway.

Is this "pilot error" or a compiler bug?
>How-To-Repeat:
g++ is_empty.cpp
./a.exe
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="is_empty.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="is_empty.cpp"

dGVtcGxhdGUgPHR5cGVuYW1lIFQ+DQpjbGFzcyBpc19jbGFzcw0Kew0KcHVibGljOg0KCXN0YXRp
YyBjb25zdCBib29sIHZhbHVlID0gZmFsc2U7DQp9Ow0KDQp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4N
CmNsYXNzIGlzX2VtcHR5X2hlbHBlcl9jbGFzc18xIDogcHVibGljIFQNCnsNCglpbnQgdW51c2Vk
WzI1Nl07DQp9Ow0KDQp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4NCmNsYXNzIGlzX2VtcHR5X2hlbHBl
cl9jbGFzc18yDQp7DQoJaW50IHVudXNlZFsyNTZdOw0KfTsNCg0KdGVtcGxhdGUgPHR5cGVuYW1l
IFQ+DQpjbGFzcyBpc19lbXB0eQ0Kew0KcHVibGljOg0KCXN0YXRpYyBjb25zdCBib29sIHZhbHVl
ID0NCgkJKA0KCQkJaXNfY2xhc3M8VD46OnZhbHVlDQoJCSYmDQoJCQkoDQoJCQkJc2l6ZW9mKGlz
X2VtcHR5X2hlbHBlcl9jbGFzc18xPFQ+KQ0KCQkJPT0NCgkJCQlzaXplb2YoaXNfZW1wdHlfaGVs
cGVyX2NsYXNzXzI8VD4pDQoJCQkpDQoJCSk7DQp9Ow0KDQojaW5jbHVkZSA8aW9zdHJlYW0+DQoN
CmludCBtYWluKCkNCnsNCglzdGQ6OmNvdXQgPDwgImlzX2NsYXNzPGJvb2w+Ojp2YWx1ZSA9ICIg
PDwgaXNfY2xhc3M8Ym9vbD46OnZhbHVlIDw8IHN0ZDo6ZW5kbDsNCglzdGQ6OmNvdXQgPDwgImlz
X2VtcHR5PGJvb2w+Ojp2YWx1ZSA9ICIgPDwgaXNfZW1wdHk8Ym9vbD46OnZhbHVlIDw8IHN0ZDo6
ZW5kbDsNCg0KCXJldHVybiAwOw0KfQ0K


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

* Re: c++/10648: template instantiation doesn't respect evaluation order of &&
@ 2003-05-07  0:34 giovannibajo
  0 siblings, 0 replies; 2+ messages in thread
From: giovannibajo @ 2003-05-07  0:34 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, notbob

Synopsis: template instantiation doesn't respect evaluation order of &&

State-Changed-From-To: open->closed
State-Changed-By: bajo
State-Changed-When: Wed May  7 00:34:17 2003
State-Changed-Why:
    Short-circuiting compilation of boolean expressions is not
    prescribed in the standard. Your code fails on any compiler
    I checked it in anyway, as a further confirm.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10648


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

end of thread, other threads:[~2003-05-07  0:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-06 22:56 c++/10648: template instantiation doesn't respect evaluation order of && notbob
2003-05-07  0:34 giovannibajo

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