Skip to content

Commit 3ced28b

Browse files
committed
[clang][Parser] Fix lookup of builtins with pragma intrinsic
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 7d44430 commit 3ced28b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

clang/lib/Parse/ParsePragma.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3800,7 +3800,7 @@ void PragmaMSIntrinsicHandler::HandlePragma(Preprocessor &PP,
38003800
// If the builtin hasn't already been declared, declare it now.
38013801
DeclarationNameInfo NameInfo(II, Tok.getLocation());
38023802
LookupResult Previous(Actions, NameInfo, Sema::LookupOrdinaryName,
3803-
Actions.forRedeclarationInCurContext());
3803+
RedeclarationKind::NotForRedeclaration);
38043804
Actions.LookupName(Previous, Actions.getCurScope(),
38053805
/*CreateBuiltins*/ false);
38063806
if (Previous.empty())
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-compatibility -fsyntax-only -verify %s
2+
3+
// expected-no-diagnostics
4+
5+
unsigned __int64 _umul128(unsigned __int64, unsigned __int64,
6+
unsigned __int64 *);
7+
8+
namespace {}
9+
#pragma intrinsic(_umul128)
10+
11+
void foo() {
12+
unsigned __int64 carry;
13+
unsigned __int64 low = _umul128(0, 0, &carry);
14+
}

0 commit comments

Comments
 (0)