http://llvm.org/bugs/show_bug.cgi?id=13988

             Bug #: 13988
           Summary: Assertion `!Init->isValueDependent()' failed.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Created attachment 9283
  --> http://llvm.org/bugs/attachment.cgi?id=9283
crash log

Assertion with r164910.

clang/lib/AST/Decl.cpp:1486: bool clang::VarDecl::checkInitIsICE() const:
 Assertion `!Init->isValueDependent()' failed.

This is the same assertion as PR12349 and PR12779 but it looks like a
different path, as this one gets there from Sema and template
instantiation while the others look like they're coming in from
Parser.  So I figured it was worth its own bug report.  Traceback
attached.  Source below shows 4 variations, only 1 asserts.  Also it
seems like one of the non-asserting cases ought to issue an error...


template < typename T1 >
struct S1
{
  template< typename T2 >
  struct S2
  {
  };
};

template< typename T3 >
struct S3
{
  // ~~~ This does not assert. Note omitted 'typename' keyword
  // ~~~ but there is no diagnostic.
  typedef S1<void>::template S2<T3> InternalType0;
  static const int Value0 = sizeof(InternalType0);

  // ~~~ This does not assert. Clang issues an error if
  // ~~~ I omit 'typename'.
  static const int Value1 = sizeof(typename S1<T3>::template S2<void>);

  // ~~~ This does not assert. Note 'typename' is present.
  typedef typename S1<T3>::template S2<void> InternalType2;
  static const int Value2 = sizeof(InternalType2);

  // ~~~ This DOES assert. Note omitted 'typename' keyword.
  typedef S1<T3>::template S2<void> InternalType3;
  static const int Value3 = sizeof(InternalType3);
};

S3<void> force_assertion;

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to