[llvm-bugs] [Bug 24902] New: Constructor over specification

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 21 10:48:06 PDT 2015


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

            Bug ID: 24902
           Summary: Constructor over specification
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ryancerium at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

#include <stdio.h>

struct Thing {
    Thing(int a) {}
};

int main(int argc, char *argv[]) {
    auto thing = new Thing::Thing(1);       
    return 0;
}


The above code snippet compiles, even though it's incorrectly referencing the
fully qualified Thing::Thing(int) constructor.  This fails in GCC and Visual
Studio, but appears to work in ICC.

The correct line of code should be:

auto thing = new Thing(1);


(Unless I'm missing another esoteric corner of C++)

-- 
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/20150921/dbbcdaa7/attachment.html>


More information about the llvm-bugs mailing list