[llvm-bugs] [Bug 42227] New: No warning for incomplete type

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 11 01:50:55 PDT 2019


            Bug ID: 42227
           Summary: No warning for incomplete type
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zhonghao at pku.org.cn
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

My clang is 9.0.0, and the code is:

enum E { a, b = true ? 1 : ((E)a, 0) };

gcc rejects it:

<source>:1:32: error: conversion to incomplete type

    1 | enum E { a, b = true ? 1 : ((E)a, 0) };

      |                                ^

Compiler returned: 1

clang accepts it, although the type is incomplete.

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/20190611/c3c3b261/attachment.html>

More information about the llvm-bugs mailing list