Open Quuxplusone opened 8 years ago
Bugzilla Link | PR30538 |
Status | NEW |
Importance | P normal |
Reported by | Chad Rosier (mcrosier@codeaurora.org) |
Reported on | 2016-09-27 09:05:08 -0700 |
Last modified on | 2016-09-27 17:31:01 -0700 |
Version | unspecified |
Hardware | PC Windows NT |
CC | dgregor@apple.com, gberry@codeaurora.org, llvm-bugs@lists.llvm.org, mcrosier@codeaurora.org, rnk@google.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
Slightly different test case that passes with GCC without error and crashes
clang:
template <class, unsigned, unsigned> class BF32 {};
template <template <class, unsigned M, unsigned = M> class BF>
class CRBase {
enum { BIT };
BF<bool, BIT> Bit;
};
CRBase<BF32> CR;
The difference is that BF32 is declared with an empty class to avoid the GCC
error. The problem appears to be related to the default parameter and the use
of an enum. If I pull the enum outside of the CRBase class clang compiles this
code without asserting.
enum { BIT };
template <class, unsigned, unsigned> class BF32 {};
template <template <class, unsigned M, unsigned = M> class BF>
class CRBase {
BF<bool, BIT> Bit;
};
CRBase<BF32> CR;