<html>
<head>
<base href="https://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 --- - MSPropertyDeclRefExpr crashes with noexcept"
href="https://llvm.org/bugs/show_bug.cgi?id=23190">23190</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>MSPropertyDeclRefExpr crashes with noexcept
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>aaron@aaronballman.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Use of an MSPropertyDeclRefExpr and a noexcept expression causes a failed
assertion. e.g.)
struct S {
__declspec(property(get=getter)) int x;
int getter() noexcept(false) { throw "hahaha"; }
};
S s;
int v = noexcept(s.x);
Yields:
E:\llvm\2013>clang -cc1 -fsyntax-only -std=c++11 "E:\Aaron
Ballman\Desktop\test.
cpp"
E:\Aaron Ballman\Desktop\test.cpp:11:18: warning: expression with side effects
h
as no effect in an unevaluated context
int v = noexcept(s.x);
^
Invalid class for expression
UNREACHABLE executed at
E:\llvm\llvm\tools\clang\lib\Sema\SemaExceptionSpec.cpp:
1149!
0x01F280B9 (0x00000016 0x470775EB 0x06AEC77C 0x06AEC708), HandleAbort() + 0x9
by
tes(s), e:\llvm\llvm\lib\support\windows\signals.inc, line 290
0x0F5FF7F9 (0x00000016 0x01F280B0 0x06AEC70C 0x01F35BB9), raise() + 0x2B9
bytes(
s)
0x0F60B284 (0x06AEE608 0x06AEC77C 0x035B11EC 0x058D9234), abort() + 0x34
bytes(s
)
0x01F35BB9 (0x058D9234 0x058D91FC 0x0000047D 0x06AEC7B8),
llvm::llvm_unreachable
_internal() + 0x89 bytes(s), e:\llvm\llvm\lib\support\errorhandling.cpp, line
11
7 + 0x8 byte(s)
0x035B11EC (0x006D7EB0 0x06AED768 0xCCCCCCCC 0xCCCCCCCC),
clang::Sema::canThrow(
) + 0x55C bytes(s), e:\llvm\llvm\tools\clang\lib\sema\semaexceptionspec.cpp,
lin
e 1158
0x032E845C (0x06AEC824 0x000000B1 0x006D7EB0 0x000000BD),
clang::Sema::BuildCXXN
oexceptExpr() + 0x7C bytes(s),
e:\llvm\llvm\tools\clang\lib\sema\semaexprcxx.cpp
, line 5800 + 0xC byte(s)
0x032E83C6 (0x06AEC824 0x000000B1 0x000000B9 0x006D7EB0),
clang::Sema::ActOnNoex
ceptExpr() + 0x26 bytes(s), e:\llvm\llvm\tools\clang\lib\sema\semaexprcxx.cpp,
l
ine 5807 + 0x18 byte(s)
0x02F7E67D (0x06AED798 0x00000000 0x00000000 0x06AED7A7),
clang::Parser::ParseCa
stExpression() + 0x241D bytes(s),
e:\llvm\llvm\tools\clang\lib\parse\parseexpr.c
pp, line 1240 + 0x4F byte(s)
0x02F7ED89 (0x06AED7CC 0x00000000 0x00000000 0x00000000),
clang::Parser::ParseCa
stExpression() + 0x39 bytes(s),
e:\llvm\llvm\tools\clang\lib\parse\parseexpr.cpp
, line 441
0x02F7B539 (0x06AEDA08 0x00000000 0x00716A58 0x06AEDAE8),
clang::Parser::ParseAs
signmentExpression() + 0x99 bytes(s),
e:\llvm\llvm\tools\clang\lib\parse\parseex
pr.cpp, line 170
0x02F6A720 (0x06AEDA08 0x06AEE228 0x06AEE608 0x00000000),
clang::Parser::ParseIn
itializer() + 0x30 bytes(s),
e:\llvm\llvm\tools\clang\include\clang\parse\parser
.h, line 1521 + 0xE byte(s)
0x02F554A1 (0x06AEDD98 0x06AEDB4C 0x00000000 0x06AEE2A8),
clang::Parser::ParseDe
clarationAfterDeclaratorAndAttributes() + 0x501 bytes(s),
e:\llvm\llvm\tools\cla
ng\lib\parse\parsedecl.cpp, line 1958
0x02F54A59 (0x06AEE5AC 0x06AEE2E0 0x00000000 0x00000000),
clang::Parser::ParseDe
clGroup() + 0x6B9 bytes(s), e:\llvm\llvm\tools\clang\lib\parse\parsedecl.cpp,
li
ne 1743 + 0x1F byte(s)
0x02F36455 (0x06AEE5AC 0x06AEE5D4 0x06AEE2E0 0x00000003),
clang::Parser::ParseDe
clOrFunctionDefInternal() + 0x2D5 bytes(s),
e:\llvm\llvm\tools\clang\lib\parse\p
arser.cpp, line 893 + 0x16 byte(s)
0x02F36109 (0x06AEE5AC 0x06AEE5D4 0x00000000 0x00000003),
clang::Parser::ParseDe
clarationOrFunctionDefinition() + 0x89 bytes(s),
e:\llvm\llvm\tools\clang\lib\pa
rse\parser.cpp, line 909 + 0x1B byte(s)
0x02F35B4C (0x06AEE5AC 0x06AEE5D4 0x00000000 0x06AEE68C),
clang::Parser::ParseEx
ternalDeclaration() + 0x90C bytes(s),
e:\llvm\llvm\tools\clang\lib\parse\parser.
cpp, line 767 + 0x16 byte(s)
0x02F32695 (0x06AEE644 0x06AEE734 0x06AEE69C 0x00716A58),
clang::Parser::ParseTo
pLevelDecl() + 0x205 bytes(s), e:\llvm\llvm\tools\clang\lib\parse\parser.cpp,
li
ne 569 + 0x12 byte(s)
0x02F30968 (0x00700608 0x00000000 0x00000000 0x06AEE6B8), clang::ParseAST() +
0x
1B8 bytes(s), e:\llvm\llvm\tools\clang\lib\parse\parseast.cpp, line 144 + 0xC
by
te(s)
0x021D3D21 (0x06AEE6E0 0xCCCCCCCC 0xCCCCCCCC 0xCCCCCCCC),
clang::ASTFrontendActi
on::ExecuteAction() + 0x101 bytes(s),
e:\llvm\llvm\tools\clang\lib\frontend\fron
tendaction.cpp, line 538 + 0x30 byte(s)
0x021D390E (0x06AEE7D8 0x00000000 0xCCCCCCCC 0xCCCCCCCC),
clang::FrontendAction:
:Execute() + 0x7E bytes(s),
e:\llvm\llvm\tools\clang\lib\frontend\frontendaction
.cpp, line 439 + 0xF byte(s)
0x0218ECA1 (0x006A6890 0x06AEECE0 0x00000000 0xCCCCCCCC),
clang::CompilerInstanc
e::ExecuteAction() + 0x2A1 bytes(s),
e:\llvm\llvm\tools\clang\lib\frontend\compi
lerinstance.cpp, line 808
0x022E506E (0x0069A948 0x06AEFA90 0xCCCCCCCC 0xCCCCCCCC),
clang::ExecuteCompiler
Invocation() + 0x30E bytes(s),
e:\llvm\llvm\tools\clang\lib\frontendtool\execute
compilerinvocation.cpp, line 222 + 0x11 byte(s)
0x00B6BC22 (0x06AEF678 0x00000003 0x006AB488 0x00AA137F), cc1_main() + 0x302
byt
es(s), e:\llvm\llvm\tools\clang\tools\driver\cc1_main.cpp, line 110 + 0xE
byte(s
)
0x00B59138 (0x06AEF670 0x00000005 0x006AB492 0x00000000), ExecuteCC1Tool() +
0x7
8 bytes(s), e:\llvm\llvm\tools\clang\tools\driver\driver.cpp, line 369 + 0x2B
by
te(s)
0x00B594DA (0x00000005 0x00697CE8 0x00694928 0x7F3A4262), main() + 0x2FA
bytes(s
), e:\llvm\llvm\tools\clang\tools\driver\driver.cpp, line 415 + 0x33 byte(s)
0x03E98E49 (0x06AEFAF4 0x766A338A 0x7EFDE000 0x06AEFB34), __tmainCRTStartup() +
0x199 bytes(s), f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c, line 626 + 0x19
byte
(s)
0x03E98F8D (0x7EFDE000 0x06AEFB34 0x77199F72 0x7EFDE000), mainCRTStartup() +
0xD
bytes(s), f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c, line 466
0x766A338A (0x7EFDE000 0x4F1BE5C2 0x00000000 0x00000000), BaseThreadInitThunk()
+ 0x12 bytes(s)
0x77199F72 (0x03E98F80 0x7EFDE000 0x00000000 0x00000000),
RtlInitializeException
Chain() + 0x63 bytes(s)
0x77199F45 (0x03E98F80 0x7EFDE000 0x00000000 0x00000000),
RtlInitializeException
Chain() + 0x36 bytes(s)
It seems that the canThrow() function has an llvm_unreachable that is actually
reachable. I believe the correct fix is to look through to the getter or setter
function the property represents to see if it throws or not. However, it seems
that we claim PseudoObjectExprClass never throws (with a FIXME), so a temporary
solution may be to move the MSPropertyRefExprClass case to be with the pseudo
object one.</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>