[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-bugs
Subject:    [LLVMbugs] [Bug 20496] New: No diagnostic for address of bit-field result of pre-increment operator
From:       bugzilla-daemon () llvm ! org
Date:       2014-07-30 23:09:16
Message-ID: bug-20496-206 () http ! llvm ! org/bugs/
[Download RAW message or body]

--1406761756.BFDbc522.26444
Date: Wed, 30 Jul 2014 18:09:16 -0500
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"

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

            Bug ID: 20496
           Summary: No diagnostic for address of bit-field result of
                    pre-increment operator
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs@nondot.org
          Reporter: hstong@ca.ibm.com
                CC: dgregor@apple.com, llvmbugs@cs.uiuc.edu
    Classification: Unclassified

N3290 subclause 5.3.2 [expr.pre.incr] paragraph 1 indicates that the result of
the prefix increment is a bit-field in the source below.

N3290 subclause 5.3.1 [expr.unary.op] paragraph 5 states that the operand of &
shall not be a bit-field.

### SOURCE:
$ cat addrBit.cc 
struct S { int a : 1; } s;
int *p = &++s.a;


### COMPILER INVOCATION AND OUTPUT:
$ clang++ -cc1 -std=c++11 -pedantic-errors -Wall -Wextra addrBit.cc; echo rc=$?
rc=0


### EXPECTED OUTPUT:
addrBit.cc:2:10: error: address of bit-field requested
int *p = &++s.a;
         ^  ~~~
1 error generated.
rc=1


### COMPILER VERSION INFO:
$ clang++ -v
clang version 3.5.0 (trunk 214060)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Selected multilib: .;@m64

-- 
You are receiving this mail because:
You are on the CC list for the bug.

--1406761756.BFDbc522.26444
Date: Wed, 30 Jul 2014 18:09:16 -0500
MIME-Version: 1.0
Content-Type: text/html; charset="UTF-8"

<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - No diagnostic for address of bit-field result of pre-increment operator"
   href="http://llvm.org/bugs/show_bug.cgi?id=20496">20496</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>No diagnostic for address of bit-field result of pre-increment operator
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs&#64;nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hstong&#64;ca.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor&#64;apple.com, llvmbugs&#64;cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>N3290 subclause 5.3.2 [expr.pre.incr] paragraph 1 indicates that the result of
the prefix increment is a bit-field in the source below.

N3290 subclause 5.3.1 [expr.unary.op] paragraph 5 states that the operand of &amp;
shall not be a bit-field.

### SOURCE:
$ cat addrBit.cc 
struct S { int a : 1; } s;
int *p = &amp;++s.a;


### COMPILER INVOCATION AND OUTPUT:
$ clang++ -cc1 -std=c++11 -pedantic-errors -Wall -Wextra addrBit.cc; echo rc=$?
rc=0


### EXPECTED OUTPUT:
addrBit.cc:2:10: error: address of bit-field requested
int *p = &amp;++s.a;
         ^  ~~~
1 error generated.
rc=1


### COMPILER VERSION INFO:
$ clang++ -v
clang version 3.5.0 (trunk 214060)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;&#64;m64
Selected multilib: .;&#64;m64</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>

--1406761756.BFDbc522.26444--


_______________________________________________
LLVMbugs mailing list
LLVMbugs@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic