File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -3795,6 +3795,8 @@ bool ByteCodeExprGen<Emitter>::VisitDeclRefExpr(const DeclRefExpr *E) {
3795
3795
if (std::optional<unsigned > I = P.getOrCreateDummy (D)) {
3796
3796
if (!this ->emitGetPtrGlobal (*I, E))
3797
3797
return false ;
3798
+ if (E->getType ()->isVoidType ())
3799
+ return true ;
3798
3800
// Convert the dummy pointer to another pointer type if we have to.
3799
3801
if (PrimType PT = classifyPrim (E); PT != PT_Ptr) {
3800
3802
if (!this ->emitDecayPtr (PT_Ptr, PT, E))
Original file line number Diff line number Diff line change @@ -278,3 +278,9 @@ void addrlabelexpr(void) {
278
278
a0 : ;
279
279
static void * ps [] = { & & a0 }; // pedantic-warning {{use of GNU address-of-label extension}}
280
280
}
281
+
282
+ extern void cv2 ;
283
+ void * foo5 (void )
284
+ {
285
+ return & cv2 ; // pedantic-warning{{address of an expression of type 'void'}}
286
+ }
You can’t perform that action at this time.
0 commit comments