[LLVMbugs] [Bug 19077] New: Wrong codegen if constexpr member function used in later member function signature

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 7 14:33:05 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=19077

            Bug ID: 19077
           Summary: Wrong codegen if constexpr member function used in
                    later member function signature
           Product: clang
           Version: 3.4
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hstong at ca.ibm.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I have not yet found wording which says the code is invalid (or results in UB),
so considering that Clang compiles it, it is a problem that the resulting
executable does not work as expected.

### SOURCE:
> cat ceVirtualMatch.cc
extern "C" int printf(const char *, ...);

struct C {
   virtual void bar(int (*)[42]) { printf("%s\n", __PRETTY_FUNCTION__); }
};

struct A : C {
   struct B {
      static constexpr int foo() { return 0; }
   };
   virtual void bar(int [][B::foo() + 42])
   { printf("%s\n", __PRETTY_FUNCTION__); }
};

int main() {
   A a;
   C &c = a;
   c.bar(0);
}
Return:  0x00:0


### ACTUAL:
> clang++ ceVirtualMatch.cc -std=c++11 && ./a.out
virtual void C::bar(int (*)[42])
Return:  0x00:0


### EXPECTED:
virtual void A::bar(int (*)[42])


### clang++ -v:
> clang++ -v
clang version 3.4 (tags/RELEASE_34/final)
Target: powerpc64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/ppc64-redhat-linux/3.4.6
Found candidate GCC installation: /usr/lib/gcc/ppc64-redhat-linux/4.4.4
Found candidate GCC installation: /usr/lib/gcc/ppc64-redhat-linux/4.4.6
Selected GCC installation: /usr/lib/gcc/ppc64-redhat-linux/4.4.6
Return:  0x00:0

-- 
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/20140307/3a7fe1ff/attachment.html>


More information about the llvm-bugs mailing list