[llvm-bugs] [Bug 40024] New: Assertion on instantiating function definition from template type function

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 14 08:16:07 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=40024

            Bug ID: 40024
           Summary: Assertion on instantiating function definition from
                    template type function
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++'17
          Assignee: unassignedclangbugs at nondot.org
          Reporter: christian.bruel at st.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Created attachment 21224
  --> https://bugs.llvm.org/attachment.cgi?id=21224&action=edit
reproduce -stdc++17

The attached code compiled with 

clang++ -std=c++17 bug.C 

asserts with

lib/Sema/SemaTemplate.cpp:6814: clang::ExprResult
clang::Sema::BuildExpressionFromDeclTemplateArgument(const
clang::TemplateArgument&, clang::QualType, clang::SourceLocation): Assertion
`!RefExpr.isInvalid() && Context.hasSameType(((Expr*)
RefExpr.get())->getType(), ParamType.getUnqualifiedType())' failed.


I'm not sure it is valid c++17. it compiles fine with c++11 and returns the
following error with g++:

error: 'int (S::*)(){((int (S::*)())S::f<110>), 0}' is not a valid template
argument for type 'int (S::*)()'

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181214/78fda084/attachment.html>


More information about the llvm-bugs mailing list