[LLVMbugs] [Bug 15105] New: Template specialization does not match for noreturn-functions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 29 04:14:43 PST 2013


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

             Bug #: 15105
           Summary: Template specialization does not match for
                    noreturn-functions
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: joerg.richter at pdv-fs.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


cat t.cc << EOF
void bar() __attribute__((noreturn));

template<class T>
struct Foo
{};

template<>
struct Foo<void()>
{
    static void func()
    {}
};

void foobar()
{
  Foo<decltype(bar)>::func();
}
EOF

clang -std=c++11 t.cc

Gives:

t.cc:16:23: error: no member named 'func' in 'Foo<void ()
__attribute__((noreturn))>'
  Foo<decltype(bar)>::func();
  ~~~~~~~~~~~~~~~~~~~~^
1 error generated.

I dont know if this is considered a bug.  But at least in gcc
attribute(noreturn) is not part of the type system and this testcase works.

If it is not a bug, how is it possible to strip this attribute from any
function type?

BTW: I think C++11 attributes don't modify the type system.

-- 
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.



More information about the llvm-bugs mailing list