[Bug c++/21510] Possible bug

2005-05-17 Thread sven at clio dot in-berlin dot de

--- Additional Comments From sven at clio dot in-berlin dot de  2005-05-17 
11:42 ---
(In reply to comment #9) 
 
 Over my dead body. :-) 
 
Oh, come on. It isn't that bad an idea to localize substitution failures, 
isn't it:-) 
  
 -- Gaby 
Sven 
 
 

-- 


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


[Bug c++/21510] Possible bug

2005-05-16 Thread sven at clio dot in-berlin dot de

--- Additional Comments From sven at clio dot in-berlin dot de  2005-05-16 
10:22 ---
(In reply to comment #7) 
  Is there a way to distinguish between unions (which are not usable as base  
  classes) and classes? If not, the standard is incomplete. 
  
 You should know that 10 years ago people didn't even imagine the kind of 
 template usages that you are assuming as obvious. Indeed, everyone wants 
 to tell unions from classes now and you bet, it will be possible sometime 
 in the future, likely not using SFINAE at all. 
 
I know and accept this. SFINAE is a possible dangerous feature, anyway. It may 
be better if the ISO standard declares something like the following 
(incomplete, feel free to propose it to the standard comitee): 
 
The pragma statements 
 
_Pragme(set, sfinae, on)   // enables SFINAE 
_Pragma(set, sfinae, off)  // disables SFINAE 
_Pragma(reset, sfinae) // sets SFINAE to the previous state 
 
control the substitution-failure-is-not-an-error-feature. When setting to on 
any substitution of a template argument of a class or function declared or 
defined in the context may fail without an error, if 
- the statement is syntactical correct 
- there is a less specific template which could be instantiated without an 
error. 
 
When leaving the context, _Pragma(reset, sfinae) is called automatical. The 
user is complete responsible for using SFINAE, no further compiler support is 
standardized. 
 
This would localize the feature and alert the user that this is a potential 
dangerous construct. And it is much more general, possible easier to 
implement. 
 

-- 


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


[Bug c++/21510] Possible bug

2005-05-16 Thread gdr at integrable-solutions dot net

--- Additional Comments From gdr at integrable-solutions dot net  
2005-05-16 19:19 ---
Subject: Re:  Possible bug

sven at clio dot in-berlin dot de [EMAIL PROTECTED] writes:

| (In reply to comment #7) 
|   Is there a way to distinguish between unions (which are not usable as 
base  
|   classes) and classes? If not, the standard is incomplete. 
|   
|  You should know that 10 years ago people didn't even imagine the kind of 
|  template usages that you are assuming as obvious. Indeed, everyone wants 
|  to tell unions from classes now and you bet, it will be possible sometime 
|  in the future, likely not using SFINAE at all. 
|  
| I know and accept this. SFINAE is a possible dangerous feature, anyway. It 
may 
| be better if the ISO standard declares something like the following 
| (incomplete, feel free to propose it to the standard comitee): 
|  
| The pragma statements 
|  
| _Pragme(set, sfinae, on)   // enables SFINAE 
| _Pragma(set, sfinae, off)  // disables SFINAE 
| _Pragma(reset, sfinae) // sets SFINAE to the previous state 

Over my dead body. :-)

-- Gaby


-- 


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


[Bug c++/21510] Possible bug

2005-05-15 Thread lerdsuwa at gcc dot gnu dot org

--- Additional Comments From lerdsuwa at gcc dot gnu dot org  2005-05-15 
12:37 ---
The code is invalid.  In the section 14.8.2 [temp.deduct] paragraph 2 of the
standard
does not include creating a class with invalid base class.  Examples of valid
SNINF cases:
- Attempting to create an array with an element type that is void, a function 
type,
  or a reference type, or attempting to create an array with a size that is zero
or negative.
- Attempting to use a type that is not a class type in a qualified name.
etc. (there are many more they are clearly mentioned in the mentioned part of
standard)

-- 
   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


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


[Bug c++/21510] Possible bug

2005-05-15 Thread sven at clio dot in-berlin dot de

--- Additional Comments From sven at clio dot in-berlin dot de  2005-05-15 
14:08 ---
(In reply to comment #3) 
 The code is invalid.  In the section 14.8.2 [temp.deduct] paragraph 2 of the 
 standard 
 does not include creating a class with invalid base class. 
 
If there is no other way to distinguish reliable between unions and classes, 
add it into the extension list. Unions should be avoided in object oriented 
design, anyway, but it is a nice-to-have feature. 
 

-- 


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


[Bug c++/21510] Possible bug

2005-05-15 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-15 
14:12 ---
(In reply to comment #4)
 If there is no other way to distinguish reliable between unions and classes, 
 add it into the extension list. Unions should be avoided in object oriented 
 design, anyway, but it is a nice-to-have feature. 

Extensions are bad.  Even just bugs in the compiler is a bad thing beause 
people would think the bug 
was an extension and start depending on it and then when the bug was fixed, 
people complain their 
code no longer compiles.

-- 


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


[Bug c++/21510] Possible bug

2005-05-15 Thread sven at clio dot in-berlin dot de

--- Additional Comments From sven at clio dot in-berlin dot de  2005-05-15 
14:46 ---
(In reply to comment #5) 
 
 Extensions are bad.  Even just bugs in the compiler is a bad thing beause 
 people would think the bug  
 was an extension and start depending on it and then when the bug was fixed,  
people complain their  
 code no longer compiles. 
 
Is there a way to distinguish between unions (which are not usable as base 
classes) and classes? If not, the standard is incomplete. 
 
 

-- 


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


[Bug c++/21510] Possible bug

2005-05-15 Thread pcarlini at suse dot de

--- Additional Comments From pcarlini at suse dot de  2005-05-15 15:03 
---
 Is there a way to distinguish between unions (which are not usable as base 
 classes) and classes? If not, the standard is incomplete.

You should know that 10 years ago people didn't even imagine the kind of
template usages that you are assuming as obvious. Indeed, everyone wants
to tell unions from classes now and you bet, it will be possible sometime
in the future, likely not using SFINAE at all. Before posting other
messages with this attitude, please, please have a look to the papers
available from the ISO Web site:

  http://www.open-std.org/jtc1/sc22/wg21/

Thanks.

-- 


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


[Bug c++/21510] Possible bug

2005-05-12 Thread sven at clio dot in-berlin dot de

--- Additional Comments From sven at clio dot in-berlin dot de  2005-05-12 
09:48 ---
 (In reply to comment #1) 
 I don't think you used SFINF correctly. 
 
The substitution of the formal parameter with the actual argument fails, thus 
it is a form of substitution failure. I do not know, if the example is 
conforming to the standard. It would be a working method to distinguish 
between classes and non classes. On the other hand the more stricter 
interpretation is more safe. 
 
 

-- 


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


[Bug c++/21510] Possible bug

2005-05-11 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-11 
11:10 ---
I don't think you used SFINF correctly.

-- 


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