Bug 46381 - G++ doesn't catch duplicate members produced by template instantiation
Summary: G++ doesn't catch duplicate members produced by template instantiation
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2010-11-08 21:32 UTC by Jason Merrill
Modified: 2021-08-05 19:23 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2021-08-05 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Merrill 2010-11-08 21:32:07 UTC
Core issue 996:

  template<typename T, typename U>
  struct Outer {
    template<typename X, typename Y> struct Inner;
    template<typename Y> struct Inner<T, Y> {};
    template<typename Y> struct Inner<U, Y> {};
  };
  Outer<int, int> outer;                      // #1

Here the instantiation of Outer<int, int> is ill-formed, because the two partial specializations of Inner have the same arguments, but we don't currently give an error.