public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17232] New: classes and class template specializations treated differently w.r.t. core issue #337
@ 2004-08-29 17:55 cludwig at cdc dot informatik dot tu-darmstadt dot de
  2004-08-29 17:58 ` [Bug c++/17232] " cludwig at cdc dot informatik dot tu-darmstadt dot de
                   ` (15 more replies)
  0 siblings, 16 replies; 24+ messages in thread
From: cludwig at cdc dot informatik dot tu-darmstadt dot de @ 2004-08-29 17:55 UTC (permalink / raw)
  To: gcc-bugs

cludwig@lap200:~/C++/gcc3.4/tmp> LC_ALL=C g++ -v 
Reading specs from /opt/gcc/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/specs 
Configured with: ../gcc-3.4.1/configure --prefix=/opt/gcc/gcc-3.4.1 
--enable-threads=posix --enable-version-specific-runtime-libs 
--enable-languages=c,c++ --enable-__cxa_atexit --enable-c-mbchar 
--enable-concept-checks --enable-libstdcxx-debug --enable-c99 
--enable-libstdcxx-pch 
Thread model: posix 
gcc version 3.4.1 
 
cludwig@lap200:~/C++/gcc3.4/tmp> cat ./is_abstract_test.cc 
template<typename T> 
class A { 
  virtual void f() = 0; 
}; 
 
class B { 
  virtual void f() = 0; 
}; 
 
template<typename T> 
int g(T (*)[1]) { 
  return 0; 
} 
 
template<typename T> 
int g(...) { 
  return 1; 
} 
 
int main() { 
  return  (g< A<int> >(0) == g< B >(0)) ; 
} 
 
cludwig@lap200:~/C++/gcc3.4/tmp> ./is_abstract_test ; echo $? 
0 
 
According to http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_defects.html#337, 
type deduction fails if it implies constructing an array of an abstract class. 
(This enables traits like boost::is_abstract<T>::value.) Therefore, above 
program is supposed to choose for both g< A<int> >() and g<B>() the second 
overload (the one that returns 1), whence the program's return value should be 
non-zero. 
 
However, g++ 3.4.1 chooses the first overload for g< A<int> >(). 
 
Regards 
 
Christoph

-- 
           Summary: classes and class template specializations treated
                    differently w.r.t. core issue #337
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cludwig at cdc dot informatik dot tu-darmstadt dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 24+ messages in thread
[parent not found: <bug-17232-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2014-07-16 13:30 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-29 17:55 [Bug c++/17232] New: classes and class template specializations treated differently w.r.t. core issue #337 cludwig at cdc dot informatik dot tu-darmstadt dot de
2004-08-29 17:58 ` [Bug c++/17232] " cludwig at cdc dot informatik dot tu-darmstadt dot de
2004-08-29 18:42 ` bangerth at dealii dot org
2004-08-29 18:57 ` cludwig at cdc dot informatik dot tu-darmstadt dot de
2004-08-30 12:30 ` giovannibajo at libero dot it
2004-08-30 13:22 ` cludwig at cdc dot informatik dot tu-darmstadt dot de
2004-08-30 14:47 ` giovannibajo at libero dot it
2004-08-30 16:05 ` bangerth at dealii dot org
2004-08-30 16:56 ` cludwig at cdc dot informatik dot tu-darmstadt dot de
2004-08-30 20:10 ` giovannibajo at libero dot it
2004-08-30 20:56 ` bangerth at dealii dot org
2004-08-30 22:12 ` jason at redhat dot com
2004-08-30 23:15 ` giovannibajo at libero dot it
2004-09-06  7:03 ` cludwig at cdc dot informatik dot tu-darmstadt dot de
2004-09-06 13:40 ` giovannibajo at libero dot it
2004-09-06 13:43 ` giovannibajo at libero dot it
2004-09-27 12:02 ` giovannibajo at libero dot it
     [not found] <bug-17232-4@http.gcc.gnu.org/bugzilla/>
2013-02-27 18:03 ` jason at gcc dot gnu.org
2013-03-17  2:37 ` jason at gcc dot gnu.org
2013-03-17 20:32 ` jason at gcc dot gnu.org
2013-03-23 17:08 ` jason at gcc dot gnu.org
2013-04-09  1:30 ` jason at gcc dot gnu.org
2014-04-22 11:37 ` jakub at gcc dot gnu.org
2014-07-16 13:31 ` jakub at gcc dot gnu.org

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