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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to