llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[clang-tidy] modernize-use-noexcept crashes on template function with dynamic exception specification

Open hongtaihu opened this issue 4 months ago • 3 comments

This input is generated by a fuzzer. https://godbolt.org/z/Pzdf8xaax

 struct S {
    template <typename T> static void f() throw(typename T::X);
    typedef decltype(f<S>()) X;
  };
[1/2] Processing file /app/\.
Error while processing /app/\.
[2/2] Processing file <source>.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /clang-tidy --checks=-*,modernize-use-noexcept \\ <source>
1.	<eof> parser at end of file
2.	ASTMatcher: Processing 'modernize-use-noexcept' against:
	CXXMethodDecl S::f : <<source>:2:27, col:62>
--- Bound Nodes Begin ---
    funcDecl - { CXXMethodDecl S::f : <<source>:2:27, col:62> }
--- Bound Nodes End ---
Program terminated with signal: SIGSEGV

hongtaihu avatar Aug 05 '26 17:08 hongtaihu

@llvm/issue-subscribers-clang-tidy

Author: Macro Terra (hongtaihu)

This input is generated by a fuzzer. https://godbolt.org/z/Pzdf8xaax ```cxx struct S { template <typename T> static void f() throw(typename T::X); typedef decltype(f<S>()) X; }; ```
[1/2] Processing file /app/\.
Error while processing /app/\.
[2/2] Processing file &lt;source&gt;.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /clang-tidy --checks=-*,modernize-use-noexcept \\ &lt;source&gt;
1.	&lt;eof&gt; parser at end of file
2.	ASTMatcher: Processing 'modernize-use-noexcept' against:
	CXXMethodDecl S::f : &lt;&lt;source&gt;:2:27, col:62&gt;
--- Bound Nodes Begin ---
    funcDecl - { CXXMethodDecl S::f : &lt;&lt;source&gt;:2:27, col:62&gt; }
--- Bound Nodes End ---
Program terminated with signal: SIGSEGV

@hongtaihu: Please don't forget to add crash label (or its more specific variant) for crashes.

EugeneZelenko avatar Aug 05 '26 17:08 EugeneZelenko

Hi, I'd like to work on this issue. Could you assign it to me?

ChrisLee02 avatar Aug 23 '26 01:08 ChrisLee02