Skip to content

volatile read discarded #11181

@llvmbot

Description

@llvmbot
Bugzilla Link 10809
Resolution INVALID
Resolved on Jun 14, 2012 14:44
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic,@rjmccall

Extended Description

Clang discards the volatile read in this testcase:

extern int could_be_volatile;
void foo() {
static_cast<volatile int>(&could_be_volatile);
}

C++11 [expr]/5 describes this as a discarded-value-expression and explains that they are to be evaluated. The volatile operation is whitelisted as undergoing lvalue-to-rvalue conversion because it is an indirection of a volatile typed object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:codegenIR generation bugs: mangling, exceptions, etc.invalidResolved as invalid, i.e. not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions