[LLVMbugs] [Bug 23383] New: Error during template instantiation in exception specification for defaulted functions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 30 13:10:56 PDT 2015


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: unassignedclangbugs at nondot.org
          Reporter: mattia.basaglia at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150430/38ae19ee/attachment.html>


More information about the llvm-bugs mailing list