[Bug c++/70563] SFINAE fails when trying invalid template instantiation

2018-05-08 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70563

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.0

--- Comment #3 from Paolo Carlini  ---
Fixed in 7.1.0.

[Bug c++/70563] SFINAE fails when trying invalid template instantiation

2018-05-08 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70563

--- Comment #2 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Tue May  8 10:03:39 2018
New Revision: 260030

URL: https://gcc.gnu.org/viewcvs?rev=260030&root=gcc&view=rev
Log:
2018-05-08  Paolo Carlini  

PR c++/70563
* g++.dg/cpp0x/sfinae62.C: New.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/sfinae62.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug c++/70563] SFINAE fails when trying invalid template instantiation

2016-06-16 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70563

Martin Sebor  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-06-16
 CC||msebor at gcc dot gnu.org
Summary|SFINEA fails when trying|SFINAE fails when trying
   |invalid template|invalid template
   |instantiation   |instantiation
 Ever confirmed|0   |1
  Known to fail||4.9.3, 5.3.0, 6.1.0, 7.0

--- Comment #1 from Martin Sebor  ---
I'm not 100% sure the code is valid but I can't find anything wrong with it and
I don't think the error message is correct.  The type it complains about being
incomplete seems complete to me.  I'm going to confirm this with the slightly
reduced test case that should also make clear which type is being instantiated
by which expression.  I note that Clang 3.8 does compile it as mentioned,
though EDG eccp does not (though the error it issues suggests it's confused by
the complicated templates).

All recent versions of GCC fail to compile the test case, although 4.9.3 with a
different error: ‘b’ is not a member of ‘C::CC >’.

$ cat u.C && /home/msebor/build/gcc-trunk-svn/gcc/xgcc -B
/home/msebor/build/gcc-trunk-svn/gcc -Wall -Wextra -Wpedantic u.C
template  using A = void;

template  struct B { };

template  class T> struct C
{
  template >
  struct CC { enum { b = 0 }; };

  template  class U, class... Ts>
  struct CC, A > > { enum { a = 1 }; };
};

template  struct D { };
template  struct E { };

enum {
  a = C::CC>::a,
  b = C::CC>::b
};
u.C:19:7: error: incomplete type ‘C::CC >’ used in nested name
specifier
   b = C::CC>::b
   ^~~~