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

            Bug ID: 23383
           Summary: Error during template instantiation in exception
                    specification for defaulted functions
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

When defining exception specification in explicitly defaulted functions, it
appears that templates aren't expanded correctly and clang gives the error
"exception specification is not available until end of class definition".

If the same template has been already expanded the error doesn't occur.

The error occurs on clang 3.6 but not on 3.5.

Follows an example (note that only the first class causes the error):


struct something { static const bool value = true; };
template<class T> struct something_template { static const bool value = true;
};

struct A_error {
    // This fails to compile
    A_error() noexcept(something_template<int>::value) = default;
};

// All of the following compile fine
struct A1 {
    A1() noexcept(1+1) = default;
};
struct A2 {
    A2() noexcept(something::value) = default;
};
struct A3 {
    void foo() noexcept(something_template<int>::value) {}
};
struct A4 {
    A4() noexcept(something_template<int>::value) {}
};
// Note: A5 is identical to A_error but it compiles fine
struct A5 {
    A5() noexcept(something_template<int>::value) = default;
};

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