This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67371] Never executed "throw" in constexpr function fails to compile


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67371

Benjamin Buch <benni.buch at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |benni.buch at gmail dot com

--- Comment #14 from Benjamin Buch <benni.buch at gmail dot com> ---
Please reopen!

Only a part of this bug is fixed:


constexpr int f(){
    if(false) throw 0;
    return 0;
}

int main(){
    constexpr auto i = f();
}


is OK now, but


constexpr int f(){
    if(true) return 0;
    throw 0;
}

int main(){
    constexpr auto i = f();
}


still fails.

Tested with:

$ g++ --version                                                                 
g++ (GCC) 8.0.0 20170818 (experimental)                                         
Copyright (C) 2017 Free Software Foundation, Inc.                               
This is free software; see the source for copying conditions.  There is NO      
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]