File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -6633,7 +6633,7 @@ bool Compiler<Emitter>::VisitUnaryOperator(const UnaryOperator *E) {
66336633 if (!this ->visit (SubExpr))
66346634 return false ;
66356635
6636- if (!this ->emitCheckNull (E))
6636+ if (!SubExpr-> getType ()-> isFunctionPointerType () && ! this ->emitCheckNull (E))
66376637 return false ;
66386638
66396639 if (classifyPrim (SubExpr) == PT_Ptr)
Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -std=c++14 -verify=both,expected %s -fexperimental-new-constant-interpreter
2+ // RUN: %clang_cc1 -std=c++14 -verify=both,ref %s
3+
4+
5+
6+ constexpr int (*null_ptr)() = nullptr;
7+ constexpr int test4 = (*null_ptr)(); // both-error {{must be initialized by a constant expression}} \
8+ // both-note {{evaluates to a null function pointer}}
9+
You can’t perform that action at this time.
0 commit comments