[llvm-bugs] [Bug 35539] New: Clang does not diagnose calls to non-constexpr member functions from constexpr member functions

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 5 13:28:46 PST 2017


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

            Bug ID: 35539
           Summary: Clang does not diagnose calls to non-constexpr member
                    functions from constexpr member functions
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: lebedev.ri at gmail.com
                CC: llvm-bugs at lists.llvm.org

Not sure if this is a gcc or clang problem.

struct A {
  void b(){}
  constexpr void c(){b();}
};

With -std=c++14, clang trunk compiles it just fine, and gcc trunk does not:
<source>: In member function 'constexpr void A::c()':
3 : <source>:3:23: error: call to non-'constexpr' function 'void A::b()'
   constexpr void c(){b();}
                      ~^~
Compiler exited with result code 1

https://godbolt.org/g/E9cioD

-- 
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/20171205/0a3c946a/attachment.html>


More information about the llvm-bugs mailing list