[LLVMbugs] [Bug 14297] New: clang allows looser exception specification in explicit template instantiation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 8 21:06:47 PST 2012


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

             Bug #: 14297
           Summary: clang allows looser exception specification in
                    explicit template instantiation
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: a.bataev at gmx.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


According to 15.4p3 "If any declaration of a function has an
exception-specification, all declarations, including the definition and an
explicit
specialization, of that function shall have an exception-specification with the
same set of type-ids".

Clang does not generate error message for the following example

struct SomeStruct{};
template <class T> void Foo(T i) throw(T) { throw i; }
template void Foo(int a) throw (char);  // explicit instantiation, argument is
deduced. Wrong exception specification is provided

int main() {
    try {
   SomeStruct slawa;
   Foo(slawa);
    }
   catch(...) { ;}
   return(0);
}

clang++ -c test.cpp

Alexey Bataev
Software Engineer
Intel Compiler Team
Intel Corp.

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